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:
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
CREATE TABLE t ( "group\nigel.farage" INTEGER ); INSERT t VALUES ( 1 ); COMMIT; SELECT @@VERSION, * FROM t; -- SQL Anywhere 9 @@VERSION,group igel.farage '188.8.131.5251',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.
answered 05 Nov '16, 08:05