Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
tarantool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
core
tarantool
Commits
4fd2556c
Commit
4fd2556c
authored
14 years ago
by
Konstantin Osipov
Browse files
Options
Downloads
Patches
Plain Diff
Test-runner: extend test coverage.
Test runner: extend test coverage. Allow non-positive numbers in the grammar.
parent
78d36e0b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
test/box/sql.result
+20
-0
20 additions, 0 deletions
test/box/sql.result
test/box/sql.test
+11
-0
11 additions, 0 deletions
test/box/sql.test
test/lib/sql.g
+1
-1
1 addition, 1 deletion
test/lib/sql.g
test/lib/sql.py
+1
-1
1 addition, 1 deletion
test/lib/sql.py
with
33 additions
and
2 deletions
test/box/sql.result
+
20
−
0
View file @
4fd2556c
...
...
@@ -53,3 +53,23 @@ Insert OK, 1 row affected
select * from t0 where k0 = 1
Found 1 tuple:
[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]
This diff is collapsed.
Click to expand it.
test/box/sql.test
+
11
−
0
View file @
4fd2556c
...
...
@@ -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
'update t0 set k1 = "Huh", k2 = "Oh-ho-ho" 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
This diff is collapsed.
Click to expand it.
test/lib/sql.g
+
1
−
1
View file @
4fd2556c
...
...
@@ -8,7 +8,7 @@ object_no_re = re.compile("[a-z_]*", re.I)
parser sql:
ignore: '\\s+'
token NUM: '[0-9]+'
token NUM: '[
+-]?[
0-9]+'
token ID: '[a-z_]+[0-9]+'
token STR: '"([^\\"]+|\\\\.)*"'
token PING: 'ping'
...
...
This diff is collapsed.
Click to expand it.
test/lib/sql.py
+
1
−
1
View file @
4fd2556c
...
...
@@ -17,7 +17,7 @@ class sqlScanner(runtime.Scanner):
(
"'
=
'"
,
re
.
compile
(
'
=
'
)),
(
"'
\\
*
'"
,
re
.
compile
(
'
\\
*
'
)),
(
'
\\
s+
'
,
re
.
compile
(
'
\\
s+
'
)),
(
'
NUM
'
,
re
.
compile
(
'
[0-9]+
'
)),
(
'
NUM
'
,
re
.
compile
(
'
[
+-]?[
0-9]+
'
)),
(
'
ID
'
,
re
.
compile
(
'
[a-z_]+[0-9]+
'
)),
(
'
STR
'
,
re
.
compile
(
'"
([^
\\
"
]+|
\\\\
.)*
"'
)),
(
'
PING
'
,
re
.
compile
(
'
ping
'
)),
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment