Summary: | Kexi crashes at the attempt to create a table row (invalid table) | ||
---|---|---|---|
Product: | [Applications] KEXI | Reporter: | Jan <cyanmystery> |
Component: | Tables | Assignee: | Jarosław Staniek <staniek> |
Status: | CLOSED FIXED | ||
Severity: | crash | CC: | adam, inksi, kdeuser, staniek |
Priority: | NOR | Keywords: | drkonqi |
Version: | 2.9.10 | ||
Target Milestone: | 2.9.11 | ||
Platform: | Arch Linux | ||
OS: | Linux | ||
Latest Commit: | http://commits.kde.org/calligra/01983252eda7087c5ff7d6971570d6d9b43559c8 | Version Fixed In: | 2.9.11 |
Attachments: |
Before crash. List interface seems to be broken.
The Database file. The same test file as original but with added 'cast' query, form, report |
Description
Jan
2015-12-18 22:54:15 UTC
Created attachment 96196 [details]
Before crash. List interface seems to be broken.
Thanks, It would be useful to have the database attached or screenshots of: table design and query design (or SQL). Created attachment 96200 [details]
The Database file.
Thanks for the quick response. Sorry I forgot to deliver more information. This is the relevant database.
Confirmed, fix in progress, thanks! Kexi broke the table internally in some way, this will be fixed so the "new" row will appear. Aside of that, even in case of the logical table defect (https://bugsfiles.kde.org/attachment.cgi?id=96196) Kexi should not crash but display error without allowing to proceed with data entry. And this is second fix we should have. *** Bug 357025 has been marked as a duplicate of this bug. *** Recommended read, a comment to a duplicated report: https://bugs.kde.org/show_bug.cgi?id=357025#c4 Here the reserved word is probably "CAST" used as a table name. sqlite3 command line tool automatically escapes the word. Kexi does not. The comment linked above explains why and what can be offered instead. Feel free to comment. Solution for Kexi 2.9 would be to not using reserved words, i.e. "cast1" or "cast_" instead of "cast". Created attachment 96375 [details]
The same test file as original but with added 'cast' query, form, report
The same test file as original but with added 'cast' query, form, report; all these use the 'cast' table so after the fix Kexi should not allow to open them in data view.
A complete fix in review: https://phabricator.kde.org/D726 Git commit 01983252eda7087c5ff7d6971570d6d9b43559c8 by Jaroslaw Staniek. Committed on 31/12/2015 at 15:17. Pushed by staniek into branch 'calligra/2.9'. Kexi: Do not switch to Data View if fetching records failed, show clear message Summary: In particular this covers the cases: - reserved word used for table name (we're not supporting it in Kexi 2.x, see bug 356888 and example attached there) - reserved word used for field name (we're not supporting it in Kexi 2.x, see bug 357025 and example attached there) - any data fetching errors - all the above is supported not only for tables (as the bug report suggests) but also for queries, forms, reports, csv export - a few API changes were required for reports Also display better error message; in addition to "Opening object "cast" failed. Switching to other view failed (Data View)." this is displayed in the details (examples): - "Error opening database cursor. near ".": syntax error" - exact SQL statement FIXED-IN:2.9.11 Test Plan: Open the 356888-Test01.kexi file attached at https://bugs.kde.org/show_bug.cgi?id=356888#attach_96375 and test the following: - open the 'cast' table in data view mode - open the 'cast' query in data view mode - open the 'cast' form in data view mode - open the 'cast' report in data view mode - right-click the 'cast' table and pick Export -> To Clipboard - right-click the 'cast' table and pick Export -> To File... In all these cases error like this should appear: "Opening object "cast" failed. Switching to other view failed (Data View) Error opening database cursor. near ".": syntax error SQL statement: SELECT movies_id, person_id, id, cast.OID FROM cast ORDER BY id" And Kexi should refuse opening the data view. Also opeining any of these objects in design view works. Then Kexi should not allow to switch to data view, displaying the same error. Reviewers: piggz Subscribers: Kexi-Devel-list Differential Revision: https://phabricator.kde.org/D726 M +27 -0 kexi/core/KexiView.cpp M +9 -0 kexi/core/KexiView.h M +2 -1 kexi/core/kexi.cpp M +5 -2 kexi/core/kexi.h M +3 -1 kexi/core/kexiproject.cpp M +23 -8 kexi/plugins/forms/kexiformview.cpp M +1 -1 kexi/plugins/forms/kexiformview.h M +13 -6 kexi/plugins/queries/kexiqueryview.cpp M +25 -21 kexi/plugins/reports/kexidbreportdata.cpp M +5 -2 kexi/plugins/reports/kexidbreportdata.h M +19 -22 kexi/plugins/reports/kexireportview.cpp M +0 -1 kexi/plugins/reports/kexireportview.h M +17 -5 kexi/plugins/reports/kexisourceselector.cpp M +8 -5 kexi/plugins/tables/kexitabledesigner_dataview.cpp M +7 -2 kexi/widget/tableview/KexiDataTableScrollArea.cpp M +6 -5 kexi/widget/tableview/KexiDataTableView.cpp M +2 -3 kexi/widget/tableview/KexiDataTableView.h M +17 -23 libs/koreport/renderer/KoReportPage.cpp M +131 -107 libs/koreport/renderer/KoReportPreRenderer.cpp M +4 -3 libs/koreport/renderer/KoReportPreRenderer.h M +3 -3 libs/koreport/tests/KoReportTest.cpp M +10 -10 plan/libs/ui/reports/reportview.cpp M +0 -1 plan/libs/ui/reports/reportview.h http://commits.kde.org/calligra/01983252eda7087c5ff7d6971570d6d9b43559c8 |