Skip to content

Commit

Permalink
dont use SQL max(id) to get last row ID inserted
Browse files Browse the repository at this point in the history
  • Loading branch information
yazz committed Jan 2, 2025
1 parent 2594d49 commit 2c0995e
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions public/go.html
Original file line number Diff line number Diff line change
Expand Up @@ -13581,12 +13581,12 @@ <h1 style='width:100%;vertical-align:top;display:inline-block;font-size:100px; t
}
}*/


let nextId = yz.uiDb.uiDbNextId ++
yz.uiDb.sqlui("INSERT INTO ui_table_debug_trace_log ( id , fk_debug_id , run_time_millis , debug_tracer_id ," +
" file_name , line_number, debug_tick ,line_text,arguments, caller_file_name , caller_line_number , " +
"fk_caller_debug_trace_log_id ) VALUES (?,?,?,?,?,?,?,?,?,?,?,?)",
[
yz.uiDb.uiDbNextId ++,
nextId,
yz.debug.currentDebugId,
Date.now(),
yz.debug.debugTracerId,
Expand All @@ -13601,8 +13601,7 @@ <h1 style='width:100%;vertical-align:top;display:inline-block;font-size:100px; t
])


let latestLogId = yz.uiDb.sqlui1("select MAX(id) as id from ui_table_debug_trace_log")
yz.debug.debugTraceSteps.push(latestLogId.id)
yz.debug.debugTraceSteps.push(nextId)
}


Expand Down Expand Up @@ -13771,10 +13770,11 @@ <h1 style='width:100%;vertical-align:top;display:inline-block;font-size:100px; t
//
// insert the trace record
//
let nextId = yz.uiDb.uiDbNextId ++
if (sourceForFunction.found) {
yz.uiDb.sqlui("INSERT INTO ui_table_debug_trace_log ( id , fk_debug_id , run_time_millis , debug_tracer_id , file_name , line_number , debug_tick,line_text) VALUES (?,?,?,?,?,?,?,?)",
[
yz.uiDb.uiDbNextId ++,
nextId,
debugId,
Date.now(),
yz.debug.debugTracerId,
Expand All @@ -13790,8 +13790,7 @@ <h1 style='width:100%;vertical-align:top;display:inline-block;font-size:100px; t
// Set the trace call log to start at the entry added into the table "ui_table_debug_trace_log"
// by just storing the "id" of the record
//
let latestLogId = yz.uiDb.sqlui1("select MAX(id) as id from ui_table_debug_trace_log")
yz.debug.debugTraceSteps.push(latestLogId.id)
yz.debug.debugTraceSteps.push(nextId)
},
endDebug: function ( ) {
//----------------------------------------------------------------------------------/
Expand Down

0 comments on commit 2c0995e

Please sign in to comment.