Issue685 - support default values for BCP In on ASE #695
Conversation
|
Re. the old Ucko PRs - A large part of them was focused on having |
|
Force pushed to fix linux build errors & missing Signoff message . I noticed while fixing failure in t0016 that t0016 is actually a BCP test framework with 16 sub-cases of BCP tests. I should be able to replace my new test d_bcp_defaultdate with another case for t0016 , will do that now and force-push if you haven't started reviewing yet. Am also working on a test that will read the same sources as t0016 but execute by calling freebcp (or even MS/ASE native bcp for reference) instead of using DBlib api. (Edit: Completed that t0016 expansion now) |
Signed-off-by: Matt McNabb <matthew.mcnabb@vmssoftware.com>
…d from data file Signed-off-by: Matt McNabb <matthew.mcnabb@vmssoftware.com>
Signed-off-by: Matt McNabb <matthew.mcnabb@vmssoftware.com>
Signed-off-by: Matt McNabb <matthew.mcnabb@vmssoftware.com>
Signed-off-by: Matt McNabb <matthew.mcnabb@vmssoftware.com>
Signed-off-by: Matt McNabb <matthew.mcnabb@vmssoftware.com>
Signed-off-by: Matt McNabb <matthew.mcnabb@vmssoftware.com>
Signed-off-by: Matt McNabb <matthew.mcnabb@vmssoftware.com>
Signed-off-by: Matt McNabb <matthew.mcnabb@vmssoftware.com>
Signed-off-by: Matt McNabb <matthew.mcnabb@vmssoftware.com>
Signed-off-by: Matt McNabb <matthew.mcnabb@vmssoftware.com>
Signed-off-by: Matt McNabb <matthew.mcnabb@vmssoftware.com>
To prepare for adding the Defaults processing Signed-off-by: Matt McNabb <matthew.mcnabb@vmssoftware.com>
Validate size is correct Signed-off-by: Matt McNabb <matthew.mcnabb@vmssoftware.com>
Signed-off-by: Matt McNabb <matthew.mcnabb@vmssoftware.com>
Signed-off-by: Matt McNabb <matthew.mcnabb@vmssoftware.com>
The validation code didn't support multiple hints,
and it truncated hints with arguments (e.g. ORDER).
The server will tell us anyway if a hint is invalid
so it doesn't seem necessary to validate at compile-time.
Signed-off-by: Matt McNabb <matthew.mcnabb@vmssoftware.com>
Signed-off-by: Matt McNabb <matthew.mcnabb@vmssoftware.com>
Signed-off-by: Matt McNabb <matthew.mcnabb@vmssoftware.com>
Signed-off-by: Matt McNabb <matthew.mcnabb@vmssoftware.com>
Signed-off-by: Matt McNabb <matthew.mcnabb@vmssoftware.com>
Helps with heap debug tracing Signed-off-by: Matt McNabb <matthew.mcnabb@vmssoftware.com>
Signed-off-by: Matt McNabb <matthew.mcnabb@vmssoftware.com>
Signed-off-by: Matt McNabb <matthew.mcnabb@vmssoftware.com>
Note use of "lock datarows" in t0016_16.sql to restrict this case to ASE, since MSSQL doesn't support BCP default values for non-nullable columns. Signed-off-by: Matt McNabb <matthew.mcnabb@vmssoftware.com>
Signed-off-by: Matt McNabb <matthew.mcnabb@vmssoftware.com>
…cked format Signed-off-by: Matt McNabb <matthew.mcnabb@vmssoftware.com>
Signed-off-by: Matt McNabb <matthew.mcnabb@vmssoftware.com>
Allow for BLOB packing too Signed-off-by: Matt McNabb <matthew.mcnabb@vmssoftware.com>
Signed-off-by: Matt McNabb <matthew.mcnabb@vmssoftware.com>
There was a problem hiding this comment.
I'm not fully happy with the commit "freebcp: also report if rows failed to copy": it only reports rows that parsed successfully in the hostfile, but were unable to be packed for upload to the server (or rejected by the server). I think it would be even better to also report rows rejected in the hostfile, and possibly warn more prominently and/or exit with a failure status code if the number of rows copied does not match the number of rows in the hostfile. It seems to me that any row in the dataset failing to upload is something the user will want to be sure to be alerted of.
|
Known outstanding issues:
Otherwise, ready for review. There are two commits near the end regarding datarows-locking that fix bugs in my previously-merged code for datarows-lock support (it didn't support temp-tables, and had a buffer overflow) |
|
@freddy77 I see in your 1.5.11 update that fixed the null BLOB problem there is some overlap with this PR , what are your plans here? Also I have ended up with this PR containing both the default values change, and a bunch of other bcp improvements that strictly speaking, aren't to do with default values. I could try to separate the other improvements to a new PR perhaps? |
|
It starts being time to prepare for a new release, there are quite some new features and improvements, especially in BCP code. Yes, a rebase on master would help. |
OK. I see now Ucko PR #558 where he had already done the Defaults change, managed to overlook that when checking his other PRs. The other changes on #558 look at first sight as if they could come in to master without too much trouble |
|
Will close this and reissue a new request on master next week |
Summary of fixes on this PR:
freebcp -nwith SQL Server has had some fixes but there are still outstanding issues regarding nulls in which are covered on 686 and I'll work on at a later dated_bcptest relating to the handling of NULL and Default Values in bcpWITH()clause). I also removed the code that validates the hints, since the database will reject an invalid hint and I don't see what we gain by rejecting the hint on client side; it seems more forwards-compatible to let the database handle this.-kflag as supported by MSBCP (ASE bcp calls it--ignoreDefaults) which means that even if a column has a default value defined, BCP inserting a NULL will actually insert NULL and not the Default Value.Most of the content is covered by the new test cases, because
freebcpis a fairly thin wrapper around DBlib bcp API. However I also have made a local test script that does a few "front door" tests callingfreebcpdirectly to test the null/default handling, and did ad-hoc testing of-k.