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
b9c4c7c0
Commit
b9c4c7c0
authored
4 years ago
by
Mergen Imeev
Committed by
Kirill Yukhin
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
lua: fix test sql/func-recreate.test.lua
Closes #4384
parent
d04e8859
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
test/sql/func-recreate.result
+11
-8
11 additions, 8 deletions
test/sql/func-recreate.result
test/sql/func-recreate.test.lua
+6
-5
6 additions, 5 deletions
test/sql/func-recreate.test.lua
test/sql/suite.ini
+0
-1
0 additions, 1 deletion
test/sql/suite.ini
with
17 additions
and
14 deletions
test/sql/func-recreate.result
+
11
−
8
View file @
b9c4c7c0
...
...
@@ -12,31 +12,34 @@ box.execute('pragma sql_default_engine=\''..engine..'\'')
fiber = require('fiber')
---
...
box.internal.sql_create_function('WAITFOR', 'INT', function (n) fiber.sleep(n) return n end)
flag = true
---
...
ch = fiber.channel(1
)
box.internal.sql_create_function('WAITFOR', 'INT', function () while flag do fiber.sleep(0.01) end return 0 end
)
---
...
_
= fiber.c
reate(function () ch:put(box.execute('select WAITFOR(0.2)')) end
)
ch
= fiber.c
hannel(1
)
---
...
fiber.
sleep(0.1
)
_ =
fiber.
create(function () ch:put(box.execute('select WAITFOR()')) end
)
---
...
box.internal.sql_create_function('WAITFOR', 'INT', function (
n
)
require('
fiber
')
.sleep(
n)
return
n
end)
box.internal.sql_create_function('WAITFOR', 'INT', function ()
while flag do
fiber.sleep(
0.01) end
return
0
end)
---
- error: 'Failed to create function ''WAITFOR'': unable to create function due to
active statements'
...
flag = false
---
...
ch:get()
---
- metadata:
- name: WAITFOR(
0.2
)
- name: WAITFOR()
type: integer
rows:
- [0
.2
]
- [0]
...
box.internal.sql_create_function('WAITFOR', 'INT', function (
n
)
require('
fiber
')
.sleep(
n)
return
n
end)
box.internal.sql_create_function('WAITFOR', 'INT', function ()
while flag do
fiber.sleep(
0.01) end
return
0
end)
---
...
This diff is collapsed.
Click to expand it.
test/sql/func-recreate.test.lua
+
6
−
5
View file @
b9c4c7c0
...
...
@@ -4,14 +4,15 @@ box.execute('pragma sql_default_engine=\''..engine..'\'')
-- Check errors during function create process
fiber
=
require
(
'fiber'
)
box
.
internal
.
sql_create_function
(
'WAITFOR'
,
'INT'
,
function
(
n
)
fiber
.
sleep
(
n
)
return
n
end
)
flag
=
true
box
.
internal
.
sql_create_function
(
'WAITFOR'
,
'INT'
,
function
()
while
flag
do
fiber
.
sleep
(
0
.
01
)
end
return
0
end
)
ch
=
fiber
.
channel
(
1
)
_
=
fiber
.
create
(
function
()
ch
:
put
(
box
.
execute
(
'select WAITFOR(0.2)'
))
end
)
fiber
.
sleep
(
0
.
1
)
_
=
fiber
.
create
(
function
()
ch
:
put
(
box
.
execute
(
'select WAITFOR()'
))
end
)
box
.
internal
.
sql_create_function
(
'WAITFOR'
,
'INT'
,
function
(
n
)
require
(
'fiber'
).
sleep
(
n
)
return
n
end
)
box
.
internal
.
sql_create_function
(
'WAITFOR'
,
'INT'
,
function
()
while
flag
do
fiber
.
sleep
(
0
.
01
)
end
return
0
end
)
flag
=
false
ch
:
get
()
box
.
internal
.
sql_create_function
(
'WAITFOR'
,
'INT'
,
function
(
n
)
require
(
'
fiber
'
)
.
sleep
(
n
)
return
n
end
)
box
.
internal
.
sql_create_function
(
'WAITFOR'
,
'INT'
,
function
()
while
flag
do
fiber
.
sleep
(
0
.
01
)
end
return
0
end
)
This diff is collapsed.
Click to expand it.
test/sql/suite.ini
+
0
−
1
View file @
b9c4c7c0
...
...
@@ -11,4 +11,3 @@ release_disabled = errinj.test.lua view_delayed_wal.test.lua sql-debug.test.lua
disabled
=
sql-statN-index-drop.test.lua
pretest_clean
=
True
fragile
=
dll.test.lua ; gh-4427
func-recreate.test.lua
; gh-4384
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