mirror of
https://github.com/oven-sh/bun
synced 2026-02-11 03:18:53 +00:00
Merge branch 'main' into ciro/fix-onclose
This commit is contained in:
@@ -312,7 +312,7 @@ pub fn getConnected(this: *MySQLConnection, _: *jsc.JSGlobalObject) JSValue {
|
||||
pub fn doClose(this: *MySQLConnection, globalObject: *jsc.JSGlobalObject, _: *jsc.CallFrame) bun.JSError!JSValue {
|
||||
_ = globalObject;
|
||||
this.disconnect();
|
||||
this.write_buffer.deinit(bun.default_allocator);
|
||||
this.write_buffer.clearAndFree(bun.default_allocator);
|
||||
|
||||
return .js_undefined;
|
||||
}
|
||||
@@ -355,16 +355,8 @@ pub fn stopTimers(this: *@This()) void {
|
||||
}
|
||||
|
||||
pub fn getQueriesArray(this: *const @This()) JSValue {
|
||||
if (this.js_value == .zero) {
|
||||
return .js_undefined;
|
||||
}
|
||||
if (js.queriesGetCached(this.js_value)) |value| {
|
||||
if (value == .zero) {
|
||||
return .js_undefined;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
return .js_undefined;
|
||||
if (this.js_value == .zero) return .js_undefined;
|
||||
return js.queriesGetCached(this.js_value) orelse .js_undefined;
|
||||
}
|
||||
pub fn failFmt(this: *@This(), error_code: AnyMySQLError.Error, comptime fmt: [:0]const u8, args: anytype) void {
|
||||
const message = bun.handleOom(std.fmt.allocPrint(bun.default_allocator, fmt, args));
|
||||
@@ -1955,7 +1947,7 @@ pub fn handleResultSet(this: *MySQLConnection, comptime Context: type, reader: N
|
||||
fn close(this: *@This()) void {
|
||||
this.disconnect();
|
||||
this.unregisterAutoFlusher();
|
||||
this.write_buffer.deinit(bun.default_allocator);
|
||||
this.write_buffer.clearAndFree(bun.default_allocator);
|
||||
}
|
||||
|
||||
pub fn closeStatement(this: *MySQLConnection, statement: *MySQLStatement) !void {
|
||||
|
||||
Reference in New Issue
Block a user