mirror of
https://github.com/nodejs/node.git
synced 2026-11-09 15:11:11 -05:00
sqlite: read column count after step in StatementSync.all()
Signed-off-by: Guilherme Araújo <arauujogui@gmail.com> PR-URL: https://github.com/nodejs/node/pull/64219 Reviewed-By: Edy Silva <edigleyssonsilva@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
1 parent
4a62a61092
commit
47e332d227
2 files changed
+74
-1
No files matched your search
+5
-1
@@ -2865,12 +2865,16 @@ MaybeLocal<Value> StatementExecutionHelper::All(Environment* env,
|
||||
Isolate* isolate = env->isolate();
|
||||
EscapableHandleScope scope(isolate);
|
||||
int r;
|
||||
int num_cols = sqlite3_column_count(stmt);
|
||||
int num_cols = 0;
|
||||
LocalVector<Value> rows(isolate);
|
||||
LocalVector<Value> row_values(isolate);
|
||||
LocalVector<Name> row_keys(isolate);
|
||||
|
||||
while ((r = sqlite3_step(stmt)) == SQLITE_ROW) {
|
||||
if (num_cols == 0) {
|
||||
num_cols = sqlite3_column_count(stmt);
|
||||
}
|
||||
|
||||
if (ExtractRowValues(env, stmt, num_cols, use_big_ints, &row_values)
|
||||
.IsNothing()) {
|
||||
return MaybeLocal<Value>();
|
||||
|
||||
Reference in new issue
Block a user