json: fix option time (fix #24242) (fix #24175) (#24243)

This commit is contained in:
kbkpbot 2025-04-17 19:45:04 +08:00 committed by GitHub
parent 4e6b56dc4a
commit dead5e69b4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 109 additions and 14 deletions

View file

@ -108,7 +108,7 @@ pub fn connect(config Config) !DB {
// It cannot be used for statements that contain binary data;
// Use `real_query()` instead.
pub fn (db &DB) query(q string) !Result {
if C.mysql_query(db.conn, q.str) != 0 {
if C.mysql_query(db.conn, charptr(q.str)) != 0 {
db.throw_mysql_error()!
}
@ -369,7 +369,7 @@ pub fn (db &DB) exec_one(query string) !Row {
mut row := Row{}
for i in 0 .. num_cols {
if unsafe { row_vals == &u8(0) } || unsafe { row_vals[i] == nil } {
if unsafe { row_vals[i] == nil } {
row.vals << ''
} else {
row.vals << mystring(unsafe { &u8(row_vals[i]) })