Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Block "begin", "commit", "rollback" in lua #1818

Open
dorinhogea opened this issue Sep 23, 2019 · 1 comment
Open

Block "begin", "commit", "rollback" in lua #1818

dorinhogea opened this issue Sep 23, 2019 · 1 comment

Comments

@dorinhogea
Copy link
Contributor

"begin","rollback", "commit" and other non sqlite requests should fail to execute in sqlite.

Steps to reproduce the behavior:
cdb2sql $SPO - <<'EOF'
create procedure rcd version 'v0' {
local function main()
local _,rc0 = db:exec("begin")
local _,rc2 = db:exec("insert into t values (2)")
local __,rc3 = db:exec("rollback")
print("rc0 = "..rc0)
print("rc2 = "..rc2)
print("rc3 = "..rc3)
end
}$$
put default procedure rcd 'v0'
exec procedure rcd()
EOF

Server Output:
rc0 = 0
rc2 = 0
rc3 = 0

The rc0 and rc3 should be set to a proper error. Currently all exec-s succeed and the row is inserted.

@akshatsikarwar
Copy link
Contributor

Additionally, executing dbstmt returned by these calls leaks a sosql session which fails an assert in subsequent runs. Minimal example:

local function main()
    db:exec("begin"):exec()
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants