diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2012-01-12 14:20:58 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2012-01-20 15:45:46 +0200 |
commit | 306781934b1ae960c7c4bab900da7b1c9d3ccaac (patch) | |
tree | 891e8ed3d1e45144ceccbbc00cca3f2bd2619643 /mssql/types | |
parent | 386162fc49b1adb266bbabc735ab28f46b98fa45 (diff) |
Change short data max and default string sizes for SQL Server
Now the default short data max is 1024, non-key string size is 512
characters, and key string size is 256 characters. Also add default
mapping for std::wstring.
Diffstat (limited to 'mssql/types')
-rw-r--r-- | mssql/types/driver.cxx | 4 | ||||
-rw-r--r-- | mssql/types/test.hxx | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/mssql/types/driver.cxx b/mssql/types/driver.cxx index f4c9452..005214a 100644 --- a/mssql/types/driver.cxx +++ b/mssql/types/driver.cxx @@ -55,7 +55,7 @@ main (int argc, char* argv[]) o.schar_ = "short data char "; o.svchar_ = "short data varchar"; - o.lchar_.assign (257, 'a'); + o.lchar_.assign (1025, 'a'); o.lvchar_ = "long data varchar"; // Test the short string optimization. o.mvchar_.assign (70000, 'm'); o.text_.assign (70000, 't'); @@ -63,7 +63,7 @@ main (int argc, char* argv[]) o.snchar_ = L"short data nchar\x1FFF\xD7FF "; o.snvchar_ = L"short data nvarchar \x1FFF\xD7FF"; - o.lnchar_.assign (129, L'\x1234'); + o.lnchar_.assign (513, L'\x1234'); o.lnvchar_ = L""; // Test empty string. o.mnvchar_.assign (70000, L'\x2345'); o.ntext_.assign (70000, L'\x4356'); diff --git a/mssql/types/test.hxx b/mssql/types/test.hxx index a0d261e..7653ec6 100644 --- a/mssql/types/test.hxx +++ b/mssql/types/test.hxx @@ -153,7 +153,7 @@ struct object #pragma db type ("VARCHAR(128)") std::string svchar_; - #pragma db type ("CHAR(257)") + #pragma db type ("CHAR(1025)") std::string lchar_; #pragma db type ("CHARACTER VARYING(8000)") @@ -173,7 +173,7 @@ struct object #pragma db type ("NVARCHAR(128)") std::wstring snvchar_; - #pragma db type ("NCHAR(129)") + #pragma db type ("NCHAR(513)") std::wstring lnchar_; #pragma db type ("NATIONAL CHARACTER VARYING(4000)") @@ -193,8 +193,8 @@ struct object #pragma db type ("VARBINARY(256)") std::vector<char> svbin_; - #pragma db type ("BINARY(257)") - char lbin_[257]; + #pragma db type ("BINARY(1025)") + char lbin_[1025]; #pragma db type ("BINARY VARYING(8000)") std::vector<char> lvbin_; |