Summary: | Kexi allows creation of table with reserved words as field names | ||
---|---|---|---|
Product: | [Applications] KEXI | Reporter: | Dimitrios T Tanis <dimitrios.tanis> |
Component: | Tables | Assignee: | Jarosław Staniek <staniek> |
Status: | CLOSED FIXED | ||
Severity: | wishlist | ||
Priority: | LO | ||
Version: | 2.4 beta1 (Calligra 2.4 beta1) | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | 2.4 (Calligra 2.4) | |
Sentry Crash Report: |
Description
Dimitrios T Tanis
2011-07-18 22:22:48 UTC
The same happens with a column named "temp". WHOOPS, I found another reserved word? We should really to something about this, for starters why not publish somewhere a list of reserved words? We can worry fixing this later. I can see another solution that we more or less have in initial stage in Kexi(DB): enclosing names in " " before sending them to database backends, including SQLite. SELECT * FROM "FROM"; could definitely work. Remaining question is: what if user writes SELECT * FROM FROM; in the SQL view. She's power user so she should consult the documentation for the list of reserved words (and Kexi can warn about this quite well). So for the latter case I agree that we can and should document reserved words for any backend in the documentation. Are you interested in helping with this? (I can guide you). Well, we can even have reserved_words property of KexiDB/Predicate driver that returns the list... I strongly think we should abide by the standards. Having single or double quotes in field names could be even more confusing as quotes are used to pass text values to the Select statement. So I lean towards the reserved words document (in the web, Documentation and Kexi) I will be glad to do it (with proper guidance). We should talk the details at the IRC. Using quotes in identifiers is a common practice in databases. Without this ability we would exclude too many common words what would be unexpected to users working with KexiSQL. We could auto-replace desc with _desc but replacing and requiring to replace with "desc" in KexiSQL (or [desc]?) would be a lot better - natural. Kexi handles the case in tables, queries and forms. A fix for reports is missing. Git commit 03b862620657fc43c95782a719da9156f313a8cc by Jaroslaw Staniek. Committed on 08/03/2012 at 01:25. Pushed by staniek into branch 'master'. Reports: Fix crash in assigning data source that uses reserved words Reports *Fix crash in assigning data source that uses reserved words as field names **Tables/queries with reserved words still do not work in reports though M +4 -0 kexi/doc/dev/CHANGELOG-Kexi-js M +3 -1 kexi/plugins/reports/kexidbreportdata.cpp http://commits.kde.org/calligra/03b862620657fc43c95782a719da9156f313a8cc Git commit 5458aeea78ab67e370b41ea9d5b2f3179ea869f6 by Jaroslaw Staniek. Committed on 08/03/2012 at 01:25. Pushed by staniek into branch 'calligra/2.4'. Reports: Fix crash in assigning data source that uses reserved words Reports *Fix crash in assigning data source that uses reserved words as field names **Tables/queries with reserved words still do not work in reports though Reviewed. M +4 -0 kexi/doc/dev/CHANGELOG-Kexi-js M +3 -1 kexi/plugins/reports/kexidbreportdata.cpp http://commits.kde.org/calligra/5458aeea78ab67e370b41ea9d5b2f3179ea869f6 Changing to a wish |