tarantool / tarantool/tarantool
sql: database should be locked for modifications during some query execution
Open
@ImeevMA is already working on this.
Since Jun 16, 2022.
bug
sql
- Dominant language
- Lua
- Stars
- 3.7k
- Forks
- 419
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 88
Description
This case was found in table-14.2 test.
You can catch main idea from this code:
local json = require("json")
box.cfg{}
box.sql.execute("create table t1(a primary key);")
box.sql.execute("create table t2(a primary key);")
box.sql.execute("insert into t2 values(1);")
box.sql.execute("insert into t2 values(2);")
local function drop_t1()
local r, msg = pcall( function () box.sql.execute("DROP TABLE t1;") end)
return msg
end
box.internal.sql_create_function("drop_t1", drop_t1)
local result = box.sql.execute("SELECT *, drop_t1() from t2;")
print(json.encode(result)) -- [[1,null],[2,"no such table: t1"]]
the result is [[1,null],[2,"no such table: t1"]] instead of
[[1,"database table is locked"],[2,"database table is locked"]]
It is even possible to drop t2 while selecting data from it.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.