GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — sqlite: restore changes from #55373 · nodejs/node@1913a4a

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src
    • node_sqlite.cc
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/node_sqlite.cc‎

Copy file name to clipboardExpand all lines: src/node_sqlite.cc
+10-6Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1510,18 +1510,22 @@ void StatementSync::All(const FunctionCallbackInfo<Value>& args) {
15101510
auto reset = OnScopeLeave([&]() { sqlite3_reset(stmt->statement_); });
15111511
int num_cols = sqlite3_column_count(stmt->statement_);
15121512
LocalVector<Value> rows(isolate);
1513+
LocalVector<Name> row_keys(isolate);
15131514
while ((r = sqlite3_step(stmt->statement_)) == SQLITE_ROW) {
1514-
LocalVector<Name> row_keys(isolate);
1515-
row_keys.reserve(num_cols);
1515+
if (row_keys.size() == 0) {
1516+
row_keys.reserve(num_cols);
1517+
for (int i = 0; i < num_cols; ++i) {
1518+
Local<Name> key;
1519+
if (!stmt->ColumnNameToName(i).ToLocal(&key)) return;
1520+
row_keys.emplace_back(key);
1521+
}
1522+
}
1523+
15161524
LocalVector<Value> row_values(isolate);
15171525
row_values.reserve(num_cols);
1518-
15191526
for (int i = 0; i < num_cols; ++i) {
1520-
Local<Name> key;
1521-
if (!stmt->ColumnNameToName(i).ToLocal(&key)) return;
15221527
Local<Value> val;
15231528
if (!stmt->ColumnToValue(i).ToLocal(&val)) return;
1524-
row_keys.emplace_back(key);
15251529
row_values.emplace_back(val);
15261530
}
15271531

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.