Skip to content
Snippets Groups Projects
Commit 69f173f2 authored by Konstantin Osipov's avatar Konstantin Osipov
Browse files

Merge branch 'test-runner'

parents 5ab352e3 4fd2556c
No related branches found
No related tags found
No related merge requests found
...@@ -53,3 +53,23 @@ Insert OK, 1 row affected ...@@ -53,3 +53,23 @@ Insert OK, 1 row affected
select * from t0 where k0 = 1 select * from t0 where k0 = 1
Found 1 tuple: Found 1 tuple:
[1, 'Huh', 'Oh-ho-ho'] [1, 'Huh', 'Oh-ho-ho']
update t0 set k1 = "", k2 = "" where k0=1
Insert OK, 1 row affected
select * from t0 where k0 = 1
Found 1 tuple:
[1, '', '']
update t0 set k1 = 2, k2 = 3 where k0=1
Insert OK, 1 row affected
select * from t0 where k0 = 1
Found 1 tuple:
[1, 2, 3]
insert into t0 values (0)
Insert OK, 1 row affected
select * from t0 where k0=0
Found 1 tuple:
[0]
insert into t0 values (4294967295)
Insert OK, 1 row affected
select * from t0 where k0=4294967295
Found 1 tuple:
[4294967295]
...@@ -28,5 +28,16 @@ exec sql 'select * from t0 where k0 = 1' ...@@ -28,5 +28,16 @@ exec sql 'select * from t0 where k0 = 1'
exec sql 'insert into t0 values (1, "I am a new tuple", "stub")' exec sql 'insert into t0 values (1, "I am a new tuple", "stub")'
exec sql 'update t0 set k1 = "Huh", k2 = "Oh-ho-ho" where k0=1' exec sql 'update t0 set k1 = "Huh", k2 = "Oh-ho-ho" where k0=1'
exec sql 'select * from t0 where k0 = 1' exec sql 'select * from t0 where k0 = 1'
# check empty strings
exec sql 'update t0 set k1 = "", k2 = "" where k0=1'
exec sql 'select * from t0 where k0 = 1'
# check type change
exec sql 'update t0 set k1 = 2, k2 = 3 where k0=1'
exec sql 'select * from t0 where k0 = 1'
# check limits
exec sql 'insert into t0 values (0)'
exec sql 'select * from t0 where k0=0'
exec sql 'insert into t0 values (4294967295)'
exec sql 'select * from t0 where k0=4294967295'
# vim: syntax=python # vim: syntax=python
...@@ -8,7 +8,7 @@ object_no_re = re.compile("[a-z_]*", re.I) ...@@ -8,7 +8,7 @@ object_no_re = re.compile("[a-z_]*", re.I)
parser sql: parser sql:
ignore: '\\s+' ignore: '\\s+'
token NUM: '[0-9]+' token NUM: '[+-]?[0-9]+'
token ID: '[a-z_]+[0-9]+' token ID: '[a-z_]+[0-9]+'
token STR: '"([^\\"]+|\\\\.)*"' token STR: '"([^\\"]+|\\\\.)*"'
token PING: 'ping' token PING: 'ping'
......
...@@ -17,7 +17,7 @@ class sqlScanner(runtime.Scanner): ...@@ -17,7 +17,7 @@ class sqlScanner(runtime.Scanner):
("'='", re.compile('=')), ("'='", re.compile('=')),
("'\\*'", re.compile('\\*')), ("'\\*'", re.compile('\\*')),
('\\s+', re.compile('\\s+')), ('\\s+', re.compile('\\s+')),
('NUM', re.compile('[0-9]+')), ('NUM', re.compile('[+-]?[0-9]+')),
('ID', re.compile('[a-z_]+[0-9]+')), ('ID', re.compile('[a-z_]+[0-9]+')),
('STR', re.compile('"([^\\"]+|\\\\.)*"')), ('STR', re.compile('"([^\\"]+|\\\\.)*"')),
('PING', re.compile('ping')), ('PING', re.compile('ping')),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment