Skip to content
Snippets Groups Projects
Commit b9c4c7c0 authored by Mergen Imeev's avatar Mergen Imeev Committed by Kirill Yukhin
Browse files

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
......@@ -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.create(function () ch:put(box.execute('select WAITFOR(0.2)')) end)
ch = fiber.channel(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)
---
...
......@@ -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)
......@@ -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
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