Skip to content

db.mysql function real_query returns proper MySQL error codes, while any stmt method doesn't #18059

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

Open
einar-hjortdal opened this issue Apr 26, 2023 · 0 comments
Labels
Bug This tag is applied to issues which reports bugs.

Comments

@einar-hjortdal
Copy link
Contributor

einar-hjortdal commented Apr 26, 2023

Describe the bug

When using real_query:

V panic: Table 'peonyDb.country' doesn't exist; code: 1146

When using stmt.prepare:

V panic: db.mysql.SQLError: Table 'peonyDb.country' doesn't exist (1) (INSERT INTO "country" ("code") VALUES (?)); code: 1

Expected Behavior

stmt methods should return proper MySQL error codes to allow for error handling.

Current Behavior

No error code is returned.

Reproduction Steps

Prepare a statement on a non-existing table.

Possible Solution

No response

Additional Information/Context

Can only test on stmt.prepare and stmt.execute because stmt.bind_result_buffer stll does not work and results cannot be fetched. Please check #17957

V version

Current V version: V 0.3.3 c4b34c9, timestamp: 2023-04-26 08:59:20 +0300

Environment details (OS name and version, etc.)

V full version: V 0.3.3 ee4150f.c4b34c9
OS: linux, Linux version 5.14.0-162.23.1.el9_1.x86_64 (mockbuild@pp-el9) (gcc (GCC) 11.3.1 20220421 (Red Hat 11.3.1-2), GNU ld version 2.35.2-24.el9) #1 SMP PREEMPT_DYNAMIC Wed Apr 12 16:23:09 UTC 2023
Processor: 4 cpus, 64bit, little endian, Intel(R) Core(TM) i3-5005U CPU @ 2.00GHz

getwd: /home/coachonko/Documents/projects/vlang/peony
vexe: /home/coachonko/.local/lib64/v/v
vexe mtime: 2023-04-26 09:47:45

vroot: OK, value: /home/coachonko/.local/lib64/v
VMODULES: OK, value: /home/coachonko/.vmodules
VTMP: OK, value: /tmp/v_1000

Git version: git version 2.31.1
Git vroot status: weekly.2023.15-62-gc4b34c94
.git/config present: true

CC version: cc (GCC) 11.3.1 20220421 (Red Hat 11.3.1-2)
thirdparty/tcc status: thirdparty-linux-amd64 12f392c3
@einar-hjortdal einar-hjortdal added the Bug This tag is applied to issues which reports bugs. label Apr 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This tag is applied to issues which reports bugs.
Projects
None yet
Development

No branches or pull requests

1 participant