summaryrefslogtreecommitdiff
path: root/odb/relational/mssql/context.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-01-23 11:40:58 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-01-23 11:40:58 +0200
commit465a4467adec94bb8fe996732ea378664fcf5e86 (patch)
tree23cb2f439313c73d4baaded034e1196eaf7c4f9b /odb/relational/mssql/context.cxx
parent4701df22146e4e4fc0c7fe58903fbd0482defcb5 (diff)
Handle SQL name limits in MySQL and SQL Server
Diffstat (limited to 'odb/relational/mssql/context.cxx')
-rw-r--r--odb/relational/mssql/context.cxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/odb/relational/mssql/context.cxx b/odb/relational/mssql/context.cxx
index e99cdaf..eac4a95 100644
--- a/odb/relational/mssql/context.cxx
+++ b/odb/relational/mssql/context.cxx
@@ -133,6 +133,18 @@ namespace relational
if (i->empty ())
continue;
+ // Warn if the name is greater than the 128 limit.
+ //
+ if (i->size () > 128)
+ {
+ cerr << "warning: SQL name '" << *i << "' is longer than the "
+ << "SQL Server name limit of 128 characters and will be "
+ << "truncated" << endl;
+
+ cerr << "info: consider shortening it using #pragma db "
+ << "table/column/index or --*-regex options" << endl;
+ }
+
if (f)
f = false;
else