Skip to content

fix(plugins): CSV, XLSX and MQL exports ignore the per-table row scope - #3197

Merged
datlechin merged 5 commits into
mainfrom
fix/export-row-scope
Sep 30, 2026
Merged

datlechin merged 5 commits into
mainfrom
fix/export-row-scope

Conversation

@datlechin

Copy link
Copy Markdown
Member

Summary

  • The export dialog offered a row scope on MongoDB, Redis and other engines without SQL, and the export then sent SELECT ... WHERE ... LIMIT to a driver that cannot run it. Root cause: the tree row showed the scope button for every object that carries rows, and ExportDataSourceAdapter.streamRows(for:) built SQL for any engine without asking whether it has a SQL dialect.
  • CSV, XLSX and MQL exports ignored a table's row filter, row limit and column choice. Root cause: those three plugins read through streamRows(table:databaseName:), which always sends SELECT *, while JSON, SQL, HTML, Markdown, XML and Parquet read through streamRows(for:).
  • MQL export wrote 64-bit integers and whole doubles as bare numbers, so a restore rounded integers past 2^53 and brought whole doubles and small 64-bit integers back as 32-bit integers. Root cause: MQLExportHelpers.mqlTextValue wrapped ObjectId, dates and decimals but let BIGINT and FLOAT fall through to a bare JSON number.
  • XLSX export could write two sheets with the same name, which Excel opens only after a repair. Root cause: XLSXWriter sanitized each sheet name on its own with no record of the names already used, and the 31-character cut removed the (N) suffix of a long table's continuation sheet.

Tests

  • ExportRowScopeAvailabilityTests: the scope is offered on PostgreSQL and MySQL tables but not on a view, not on MongoDB or Redis, and a saved selection's scope is cleared on MongoDB. 2 of its 3 cases fail without the fix.
  • ExportDataSourceAdapterRowScopeTests: a scoped read on MongoDB fails and sends the driver no statement, and on PostgreSQL it sends one statement ending in LIMIT 1. Without the adapter guard the MongoDB case fails, because the driver receives SELECT * FROM "users" LIMIT 1.
  • ExportFormatRowScopeTests: CSV, XLSX and MQL exports of a one-row scope hold only the first row. All 3 cases fail without the fix.
  • MQLExportHelpersTests: bigintExportsAsNumberLong and wholeDoubleExportsAsDouble fail without the fix. nonIntegerInBigintColumnIsNotWrapped and doubleThatReadsBackAsDoubleStaysBare pin the values that must stay bare.
  • XLSXWriterSheetNameTests: a repeated name, a name that differs only in case and two long names that share their first 31 characters each get distinct names within 31 characters, and a continuation sheet keeps its (2). All 5 cases fail without the fix.
  • 139 cases across 21 suites pass, including CSVExportBytesTests, TableTransferServiceTests, LeadingRowsStatementTests and StringCatalogIntegrityTests.
  • No UI test: the filter icon disappears only on engines without SQL, and TableProUITests has no MongoDB or Redis server. ExportRowScopeAvailabilityTests pins the rule the row reads.

Docs

The docs rewrite branch covers the user-facing text: the filter icon on engines without SQL, the MQL number types and the XLSX sheet names.

Signed-off-by: Ngô Quốc Đạt <datlechin@gmail.com>
@datlechin
datlechin merged commit 91150eb into main Sep 30, 2026
5 checks passed
@datlechin
datlechin deleted the fix/export-row-scope branch September 30, 2026 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant