on 2016 Nov 03 9:41 AM
v 16.0.0.2213
If a user name starts with an N we get an error when trying to reload the database structure. Using default choices throughout, the reload.sql file contains lines like:
GRANT INTEGRATED LOGIN TO "group\\nigel.farage" AS USER "nigel.farage" go COMMENT ON INTEGRATED LOGIN "group\\nigel.farage" IS NULL Go
this generates errors:
Could not execute statement. Syntax error near 'group igel.farage' on line 1 SQLCODE=-131, ODBC 3 State="42000" Line 142228, column 1 (Continuing after error)because the \\n is being treated as a new line character. Manually editing the reload.sql file:Could not execute statement. Syntax error near 'group igel.farage' on line 1 SQLCODE=-131, ODBC 3 State="42000" Line 142231, column 1 (Continuing after error)
GRANT INTEGRATED LOGIN TO "group\\\\nigel.farage" AS USER "nigel.farage" go COMMENT ON INTEGRATED LOGIN "group\\\\nigel.farage" IS NULL Gofixes the problem.
I encountered the problem when unloading a v11 file to upgrade, but the problem persists when unloading v16 format databases as well. Problem is also present in build 2344 - see below.
Reported to SAP as incident ID:002075129400004752422016
Fixed by Engineering Case 804480 SAP SQL Anywhere Version 16.0.0 build 2417 SAP SQL Anywhere Version 17.0 build 2795
It looks like a bug behavior change to me, since "group\\nigel.farage" is not a string literal, it is a quoted identifier.
The bug behavior change was introduced in Version 10.
CREATE TABLE t ( "group\\nigel.farage" INTEGER ); INSERT t VALUES ( 1 ); COMMIT; SELECT @@VERSION, * FROM t; -- SQL Anywhere 9 @@VERSION,group igel.farage '9.0.2.3951',1 -- SQL Anywhere 10 Could not execute statement. Syntax error near 'group igel.farage' on line 1 SQLCODE=-131, ODBC 3 State="42000" Line 1, column 1 CREATE TABLE t ( "group\\nigel.farage" INTEGER );
I wish there was a global server option that would completely turn off the stupid arcane unnecessary special character processing in string literals. Nobody needs \\n to mean new line, but they ABSOLUTELY POSITIVELY FREQUENTLY DO NEED \\ CHARACTERS in string literals.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Nobody needs \\n to mean new line
Hm, I do often need new lines in strings - and probably most folks with a C-based background at least are aware of "\\n" as a platform-independent notation for that.
However, an option would be handy, I agree.
Breck, the noticed behaviour change between v9 and v10 seems to have to do with the fact that for v10 and above, identifiers (even quoted ones) are not allowed to contain (among others)
Control characters (characters with an ordinal value of less than 32, or the character value 127).. Backslashes
and therefore '\\n', '\\t' and '\\' are not allowed there.
For v9 and below, the rules for (quoted) identifiers were less stringent:
Identifiers need to be enclosed in double quotes or square brackets if any of the following conditions are true:
[...]
The identifier contains characters other than alphabetic characters and digits.
However, I'n mot sure whether this does apply to Justin's case:
The user profile name used for integrated Windoes login names requires the '\\' to separate domain and user name. Nevertheless, the docs leave open whether the <user-profile-name> is an identifier or not... - But apparently it is a bug if you can create such login names but they get messed up during a reload.
User | Count |
---|---|
62 | |
10 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.