You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[P1] [security] "Copy as INSERT" generates SQL with hardcoded your_table placeholder
Context
The grid's row context menu has "Copy as INSERT" which copies INSERT INTO your_table (cols) VALUES (vals); to the clipboard.
Problem
Per docs/audits/results.md F16.
The user pastes the SQL into the editor and runs it → MySQL rejects with "Table 'sqlpilot.your_table' doesn't exist". If the user has a table literally named your_table, it silently succeeds. The export pipeline (exportResults in tauri-api.ts:104-106) already takes a tableName param but the grid's context-menu builder doesn't pass it.
Files
src/components/grid/ResultsGrid.tsx:191-194
Repro (if applicable)
Static analysis only.
Expected
Right-click row from SELECT * FROM users → copies INSERT INTO \users` (cols) VALUES (vals);`. For CTE/subquery where table can't be extracted → menu item is greyed out.
Proposed fix
Scope S. Run extractTableName from getCurrentSql() at menu-open time; pass the resolved table into the menu builder. If extraction fails, render the menu item as disabled.
Acceptance
Right-click → copies with detected table; no-op when table can't be detected.
Activity
fix(grid): make Copy as INSERT name the table the rows came from (#539)
feat(grid): select rows, and copy them in the formats people paste into
feat(grid): select rows, and copy them in the formats people paste in…