Changeset: df221e8a101b for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=df221e8a101b
Modified Files:
        sql/test/BugTracker-2014/Tests/copy-into.Bug-3481.SQL.py
        sql/test/BugTracker-2014/Tests/utf8bom.Bug-3436.SQL.py
        sql/test/BugTracker-2016/Tests/convert-function-test.Bug-3460.sql
        sql/test/BugTracker-2016/Tests/convert-function-test.Bug-3460.stable.out
        
sql/test/BugTracker-2016/Tests/convert-function-test.Bug-3460.stable.out.int128
        
sql/test/BugTracker-2019/Tests/copy-into-from-stdin-empty-line.Bug-6669.sql
        sql/test/BugTracker-2019/Tests/insert-into-select.Bug-6718.sql
        sql/test/BugTracker-2019/Tests/python-loader-string.Bug-6759.py
        sql/test/Users/Tests/copyinto.SQL.py
        sql/test/Users/Tests/copyinto.stable.err
Branch: Jun2020
Log Message:

Fix tests to only use r or e prefix strings when \s are involved.
The tests now work equally well with the MonetDB and SQL way of
parsing single quoted strings without e or r prefix.


diffs (truncated from 879 to 300 lines):

diff --git a/sql/test/BugTracker-2014/Tests/copy-into.Bug-3481.SQL.py 
b/sql/test/BugTracker-2014/Tests/copy-into.Bug-3481.SQL.py
--- a/sql/test/BugTracker-2014/Tests/copy-into.Bug-3481.SQL.py
+++ b/sql/test/BugTracker-2014/Tests/copy-into.Bug-3481.SQL.py
@@ -25,7 +25,7 @@ def query(conn, sql, result=False):
 create1 = """-- some comment
 START TRANSACTION;
 CREATE TABLE a(i integer);
-COPY 1 RECORDS INTO a FROM STDIN USING DELIMITERS ',','\\n','"';
+COPY 1 RECORDS INTO a FROM STDIN USING DELIMITERS ',',E'\\n','"';
 42
 COMMIT;
 """
@@ -33,10 +33,10 @@ COMMIT;
 create2 = """-- some comment
 START TRANSACTION;
 CREATE TABLE b(i integer);
-COPY 1 RECORDS INTO b FROM STDIN USING DELIMITERS ',','\\n','"';
+COPY 1 RECORDS INTO b FROM STDIN USING DELIMITERS ',',E'\\n','"';
 42
 CREATE TABLE c(i integer);
-COPY 2 RECORDS INTO c FROM STDIN USING DELIMITERS ',','\\n','"';
+COPY 2 RECORDS INTO c FROM STDIN USING DELIMITERS ',',E'\\n','"';
 42
 84
 COMMIT;
diff --git a/sql/test/BugTracker-2014/Tests/utf8bom.Bug-3436.SQL.py 
b/sql/test/BugTracker-2014/Tests/utf8bom.Bug-3436.SQL.py
--- a/sql/test/BugTracker-2014/Tests/utf8bom.Bug-3436.SQL.py
+++ b/sql/test/BugTracker-2014/Tests/utf8bom.Bug-3436.SQL.py
@@ -34,13 +34,13 @@ create table utf8bom (
     city string,
     id integer
 );
-copy into utf8bom from '%s' using delimiters ',','\\n','"';
+copy into utf8bom from r'%s' using delimiters ',',E'\\n','"';
 select * from utf8bom order by id;
 rollback;
 '''
 
 with process.client('sql', stdin = process.PIPE, stdout = process.PIPE, stderr 
= process.PIPE) as c:
-    c.stdin.write(query % os.path.join(TSTTRGDIR, 'utf8bom.csv').replace('\\', 
r'\\'))
+    c.stdin.write(query % os.path.join(TSTTRGDIR, 'utf8bom.csv'))
     out, err = c.communicate()
     sys.stdout.write(out)
     sys.stderr.write(err)
diff --git a/sql/test/BugTracker-2016/Tests/convert-function-test.Bug-3460.sql 
b/sql/test/BugTracker-2016/Tests/convert-function-test.Bug-3460.sql
--- a/sql/test/BugTracker-2016/Tests/convert-function-test.Bug-3460.sql
+++ b/sql/test/BugTracker-2016/Tests/convert-function-test.Bug-3460.sql
@@ -1027,7 +1027,7 @@ DROP TABLE T_dec;
 
 -- CHAR, VARCHAR, LONGVARCHAR, CLOB
 CREATE TABLE T_char (v CHAR(33));
-INSERT into T_char VALUES ('0'), ('1'), ('0123456789'), ('AaZz'), 
('~!@#$%^&*('')\_/-+=:;"<.,.>?'), ('');
+INSERT into T_char VALUES ('0'), ('1'), ('0123456789'), ('AaZz'), 
(r'~!@#$%^&*('')\_/-+=:;"<.,.>?'), ('');
 INSERT into T_char VALUES (null);
 SELECT v FROM T_char ORDER BY v;
 
@@ -1117,7 +1117,7 @@ DROP TABLE T_char;
 
 -- VARCHAR
 CREATE TABLE T_varchar (v VARCHAR(33));
-INSERT into T_varchar VALUES ('0'), ('1'), ('0123456789'), ('AaZz'), 
('~!@#$%^&*('')\_/-+=:;"<.,.>?'), ('');
+INSERT into T_varchar VALUES ('0'), ('1'), ('0123456789'), ('AaZz'), 
(r'~!@#$%^&*('')\_/-+=:;"<.,.>?'), ('');
 INSERT into T_varchar VALUES (null);
 SELECT v FROM T_varchar ORDER BY v;
 
@@ -1208,7 +1208,7 @@ DROP TABLE T_varchar;
 -- LONG VARCHAR is NOT (yet) supported
 /* disabled test for now, enable it when it is supported
 CREATE TABLE T_longvarchar (v LONG VARCHAR);
-INSERT into T_longvarchar VALUES ('0'), ('1'), ('0123456789'), ('AaZz'), 
('~!@#$%^&*('')\_/-+=:;"<.,.>?'), ('');
+INSERT into T_longvarchar VALUES ('0'), ('1'), ('0123456789'), ('AaZz'), 
(r'~!@#$%^&*('')\_/-+=:;"<.,.>?'), ('');
 INSERT into T_longvarchar VALUES (null);
 SELECT v FROM T_longvarchar ORDER BY v;
 
@@ -1299,7 +1299,7 @@ DROP TABLE T_longvarchar;
 
 -- CLOB
 CREATE TABLE T_clob (v CLOB);
-INSERT into T_clob VALUES ('0'), ('1'), ('0123456789'), ('AaZz'), 
('~!@#$%^&*('')\_/-+=:;"<.,.>?'), ('');
+INSERT into T_clob VALUES ('0'), ('1'), ('0123456789'), ('AaZz'), 
(r'~!@#$%^&*('')\_/-+=:;"<.,.>?'), ('');
 INSERT into T_clob VALUES (null);
 SELECT v FROM T_clob ORDER BY v;
 
diff --git 
a/sql/test/BugTracker-2016/Tests/convert-function-test.Bug-3460.stable.out 
b/sql/test/BugTracker-2016/Tests/convert-function-test.Bug-3460.stable.out
--- a/sql/test/BugTracker-2016/Tests/convert-function-test.Bug-3460.stable.out
+++ b/sql/test/BugTracker-2016/Tests/convert-function-test.Bug-3460.stable.out
@@ -5541,7 +5541,7 @@ stdout of test 'convert-function-test.Bu
 [ "0123456789" ]
 [ "1"  ]
 [ "AaZz"       ]
-[ "~!@#$%^&*(')_/-+=:;\"<.,.>?"        ]
+[ "~!@#$%^&*(')\\_/-+=:;\"<.,.>?"      ]
 #SELECT v, convert(v, boolean) from T_char where v in ('0', '1');
 % sys.t_char,  sys.t_char # table_name
 % v,   v # name
@@ -5656,7 +5656,7 @@ stdout of test 'convert-function-test.Bu
 [ "1", 1.000   ]
 #SELECT v, convert(v, char) from T_char where v in ('0', '1');
 % sys.t_char,  sys. # table_name
-% v,   %3 # name
+% v,   %5 # name
 % char,        char # type
 % 33,  1 # length
 [ "0", "0"     ]
@@ -5665,12 +5665,12 @@ stdout of test 'convert-function-test.Bu
 % sys.t_char,  sys. # table_name
 % v,   %2 # name
 % char,        varchar # type
-% 33,  26 # length
+% 33,  27 # length
 [ "0", "0"     ]
 [ "1", "1"     ]
 [ "0123456789",        "0123456789"    ]
 [ "AaZz",      "AaZz"  ]
-[ "~!@#$%^&*(')_/-+=:;\"<.,.>?",       "~!@#$%^&*(')_/-+=:;\"<.,.>?"   ]
+[ "~!@#$%^&*(')\\_/-+=:;\"<.,.>?",     "~!@#$%^&*(')\\_/-+=:;\"<.,.>?" ]
 [ "",  ""      ]
 [ NULL,        NULL    ]
 #SELECT v, convert(v, CHARACTER LARGE OBJECT) from T_char;
@@ -5682,7 +5682,7 @@ stdout of test 'convert-function-test.Bu
 [ "1", "1"     ]
 [ "0123456789",        "0123456789"    ]
 [ "AaZz",      "AaZz"  ]
-[ "~!@#$%^&*(')_/-+=:;\"<.,.>?",       "~!@#$%^&*(')_/-+=:;\"<.,.>?"   ]
+[ "~!@#$%^&*(')\\_/-+=:;\"<.,.>?",     "~!@#$%^&*(')\\_/-+=:;\"<.,.>?" ]
 [ "",  ""      ]
 [ NULL,        NULL    ]
 #SELECT v, convert(v, Clob) from T_char;
@@ -5694,7 +5694,7 @@ stdout of test 'convert-function-test.Bu
 [ "1", "1"     ]
 [ "0123456789",        "0123456789"    ]
 [ "AaZz",      "AaZz"  ]
-[ "~!@#$%^&*(')_/-+=:;\"<.,.>?",       "~!@#$%^&*(')_/-+=:;\"<.,.>?"   ]
+[ "~!@#$%^&*(')\\_/-+=:;\"<.,.>?",     "~!@#$%^&*(')\\_/-+=:;\"<.,.>?" ]
 [ "",  ""      ]
 [ NULL,        NULL    ]
 #SELECT v, convert(v, Blob) from T_char where v in ('0123456789');
@@ -5817,7 +5817,7 @@ stdout of test 'convert-function-test.Bu
 [ "1", 1.000   ]
 #SELECT v, cast(v as char) from T_char where v in ('0', '1');
 % sys.t_char,  sys. # table_name
-% v,   %3 # name
+% v,   %5 # name
 % char,        char # type
 % 33,  1 # length
 [ "0", "0"     ]
@@ -5826,12 +5826,12 @@ stdout of test 'convert-function-test.Bu
 % sys.t_char,  sys. # table_name
 % v,   %2 # name
 % char,        varchar # type
-% 33,  26 # length
+% 33,  27 # length
 [ "0", "0"     ]
 [ "1", "1"     ]
 [ "0123456789",        "0123456789"    ]
 [ "AaZz",      "AaZz"  ]
-[ "~!@#$%^&*(')_/-+=:;\"<.,.>?",       "~!@#$%^&*(')_/-+=:;\"<.,.>?"   ]
+[ "~!@#$%^&*(')\\_/-+=:;\"<.,.>?",     "~!@#$%^&*(')\\_/-+=:;\"<.,.>?" ]
 [ "",  ""      ]
 [ NULL,        NULL    ]
 #SELECT v, cast(v as CHARACTER LARGE OBJECT) from T_char;
@@ -5843,7 +5843,7 @@ stdout of test 'convert-function-test.Bu
 [ "1", "1"     ]
 [ "0123456789",        "0123456789"    ]
 [ "AaZz",      "AaZz"  ]
-[ "~!@#$%^&*(')_/-+=:;\"<.,.>?",       "~!@#$%^&*(')_/-+=:;\"<.,.>?"   ]
+[ "~!@#$%^&*(')\\_/-+=:;\"<.,.>?",     "~!@#$%^&*(')\\_/-+=:;\"<.,.>?" ]
 [ "",  ""      ]
 [ NULL,        NULL    ]
 #SELECT v, cast(v as Clob) from T_char;
@@ -5855,7 +5855,7 @@ stdout of test 'convert-function-test.Bu
 [ "1", "1"     ]
 [ "0123456789",        "0123456789"    ]
 [ "AaZz",      "AaZz"  ]
-[ "~!@#$%^&*(')_/-+=:;\"<.,.>?",       "~!@#$%^&*(')_/-+=:;\"<.,.>?"   ]
+[ "~!@#$%^&*(')\\_/-+=:;\"<.,.>?",     "~!@#$%^&*(')\\_/-+=:;\"<.,.>?" ]
 [ "",  ""      ]
 [ NULL,        NULL    ]
 #SELECT v, cast(v as Blob) from T_char where v in ('0123456789');
@@ -5874,14 +5874,14 @@ stdout of test 'convert-function-test.Bu
 % sys.t_varchar # table_name
 % v # name
 % varchar # type
-% 26 # length
+% 27 # length
 [ NULL ]
 [ ""   ]
 [ "0"  ]
 [ "0123456789" ]
 [ "1"  ]
 [ "AaZz"       ]
-[ "~!@#$%^&*(')_/-+=:;\"<.,.>?"        ]
+[ "~!@#$%^&*(')\\_/-+=:;\"<.,.>?"      ]
 #SELECT v, convert(v, boolean) from T_varchar where v in ('0', '1');
 % sys.t_varchar,       sys.t_varchar # table_name
 % v,   v # name
@@ -5996,7 +5996,7 @@ stdout of test 'convert-function-test.Bu
 [ "1", 1.000   ]
 #SELECT v, convert(v, char) from T_varchar where v in ('0', '1');
 % sys.t_varchar,       sys. # table_name
-% v,   %3 # name
+% v,   %5 # name
 % varchar,     char # type
 % 1,   1 # length
 [ "0", "0"     ]
@@ -6005,36 +6005,36 @@ stdout of test 'convert-function-test.Bu
 % sys.t_varchar,       sys. # table_name
 % v,   %2 # name
 % varchar,     varchar # type
-% 26,  26 # length
+% 27,  27 # length
 [ "0", "0"     ]
 [ "1", "1"     ]
 [ "0123456789",        "0123456789"    ]
 [ "AaZz",      "AaZz"  ]
-[ "~!@#$%^&*(')_/-+=:;\"<.,.>?",       "~!@#$%^&*(')_/-+=:;\"<.,.>?"   ]
+[ "~!@#$%^&*(')\\_/-+=:;\"<.,.>?",     "~!@#$%^&*(')\\_/-+=:;\"<.,.>?" ]
 [ "",  ""      ]
 [ NULL,        NULL    ]
 #SELECT v, convert(v, CHARACTER LARGE OBJECT) from T_varchar;
 % sys.t_varchar,       sys.t_varchar # table_name
 % v,   v # name
 % varchar,     varchar # type
-% 26,  26 # length
+% 27,  27 # length
 [ "0", "0"     ]
 [ "1", "1"     ]
 [ "0123456789",        "0123456789"    ]
 [ "AaZz",      "AaZz"  ]
-[ "~!@#$%^&*(')_/-+=:;\"<.,.>?",       "~!@#$%^&*(')_/-+=:;\"<.,.>?"   ]
+[ "~!@#$%^&*(')\\_/-+=:;\"<.,.>?",     "~!@#$%^&*(')\\_/-+=:;\"<.,.>?" ]
 [ "",  ""      ]
 [ NULL,        NULL    ]
 #SELECT v, convert(v, Clob) from T_varchar;
 % sys.t_varchar,       sys.t_varchar # table_name
 % v,   v # name
 % varchar,     varchar # type
-% 26,  26 # length
+% 27,  27 # length
 [ "0", "0"     ]
 [ "1", "1"     ]
 [ "0123456789",        "0123456789"    ]
 [ "AaZz",      "AaZz"  ]
-[ "~!@#$%^&*(')_/-+=:;\"<.,.>?",       "~!@#$%^&*(')_/-+=:;\"<.,.>?"   ]
+[ "~!@#$%^&*(')\\_/-+=:;\"<.,.>?",     "~!@#$%^&*(')\\_/-+=:;\"<.,.>?" ]
 [ "",  ""      ]
 [ NULL,        NULL    ]
 #SELECT v, convert(v, Blob) from T_varchar where v in ('0123456789');
@@ -6157,7 +6157,7 @@ stdout of test 'convert-function-test.Bu
 [ "1", 1.000   ]
 #SELECT v, cast(v as char) from T_varchar where v in ('0', '1');
 % sys.t_varchar,       sys. # table_name
-% v,   %3 # name
+% v,   %5 # name
 % varchar,     char # type
 % 1,   1 # length
 [ "0", "0"     ]
@@ -6166,36 +6166,36 @@ stdout of test 'convert-function-test.Bu
 % sys.t_varchar,       sys. # table_name
 % v,   %2 # name
 % varchar,     varchar # type
-% 26,  26 # length
+% 27,  27 # length
 [ "0", "0"     ]
 [ "1", "1"     ]
 [ "0123456789",        "0123456789"    ]
 [ "AaZz",      "AaZz"  ]
-[ "~!@#$%^&*(')_/-+=:;\"<.,.>?",       "~!@#$%^&*(')_/-+=:;\"<.,.>?"   ]
+[ "~!@#$%^&*(')\\_/-+=:;\"<.,.>?",     "~!@#$%^&*(')\\_/-+=:;\"<.,.>?" ]
 [ "",  ""      ]
 [ NULL,        NULL    ]
 #SELECT v, cast(v as CHARACTER LARGE OBJECT) from T_varchar;
 % sys.t_varchar,       sys.t_varchar # table_name
 % v,   v # name
 % varchar,     varchar # type
-% 26,  26 # length
+% 27,  27 # length
 [ "0", "0"     ]
 [ "1", "1"     ]
 [ "0123456789",        "0123456789"    ]
 [ "AaZz",      "AaZz"  ]
-[ "~!@#$%^&*(')_/-+=:;\"<.,.>?",       "~!@#$%^&*(')_/-+=:;\"<.,.>?"   ]
+[ "~!@#$%^&*(')\\_/-+=:;\"<.,.>?",     "~!@#$%^&*(')\\_/-+=:;\"<.,.>?" ]
 [ "",  ""      ]
 [ NULL,        NULL    ]
 #SELECT v, cast(v as Clob) from T_varchar;
 % sys.t_varchar,       sys.t_varchar # table_name
 % v,   v # name
 % varchar,     varchar # type
-% 26,  26 # length
+% 27,  27 # length
 [ "0", "0"     ]
 [ "1", "1"     ]
 [ "0123456789",        "0123456789"    ]
 [ "AaZz",      "AaZz"  ]
-[ "~!@#$%^&*(')_/-+=:;\"<.,.>?",       "~!@#$%^&*(')_/-+=:;\"<.,.>?"   ]
+[ "~!@#$%^&*(')\\_/-+=:;\"<.,.>?",     "~!@#$%^&*(')\\_/-+=:;\"<.,.>?" ]
 [ "",  ""      ]
 [ NULL,        NULL    ]
 #SELECT v, cast(v as Blob) from T_varchar where v in ('0123456789');
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to