fix(plugins): CSV, XLSX and MQL exports ignore the per-table row scope - #3197
Merged
Merged
Conversation
…through their type constructors
Signed-off-by: Ngô Quốc Đạt <datlechin@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SELECT ... WHERE ... LIMITto a driver that cannot run it. Root cause: the tree row showed the scope button for every object that carries rows, andExportDataSourceAdapter.streamRows(for:)built SQL for any engine without asking whether it has a SQL dialect.streamRows(table:databaseName:), which always sendsSELECT *, while JSON, SQL, HTML, Markdown, XML and Parquet read throughstreamRows(for:).MQLExportHelpers.mqlTextValuewrappedObjectId, dates and decimals but letBIGINTandFLOATfall through to a bare JSON number.XLSXWritersanitized 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 inLIMIT 1. Without the adapter guard the MongoDB case fails, because the driver receivesSELECT * 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:bigintExportsAsNumberLongandwholeDoubleExportsAsDoublefail without the fix.nonIntegerInBigintColumnIsNotWrappedanddoubleThatReadsBackAsDoubleStaysBarepin 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.CSVExportBytesTests,TableTransferServiceTests,LeadingRowsStatementTestsandStringCatalogIntegrityTests.ExportRowScopeAvailabilityTestspins 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.