Bug 307479

Summary: Kexi refuses to delete imported tables
Product: [Applications] KEXI Reporter: Guido Schmidt <guido>
Component: GeneralAssignee: Jarosław Staniek <staniek>
Status: CLOSED FIXED    
Severity: major    
Priority: NOR    
Version: 2.5.2   
Target Milestone: 2.5   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In: 2.5.3
Attachments: Database with two undeletable tables

Description Guido Schmidt 2012-09-27 12:25:14 UTC
I imported a couple of simple tables (all empty). It is not possible to delete them. When I try I always get a message "Could not remove object."

Deleting a table I created using Kexi works.

Reproducible: Always

Steps to Reproduce:
1. Import tables from a distant MySQL-server into another db on the same server.
2. Select a table.
3. Press the delete-button.
4. Confirm the delete-warning.
Actual Results:  
The error-message "Could not remove object." appears.

Expected Results:  
The table should get deleted. If this is not possible because of any dependencies that have to be removed first (although I think in my case there aren't any) the message should point to them or - even better - offer to remove them too.
Comment 1 Jarosław Staniek 2012-09-27 21:12:49 UTC
Thanks for reporting. Could you please attach a sample database having the issue (below)? 
Can be the one with empty table(s).
Comment 2 Guido Schmidt 2012-09-29 13:46:16 UTC
Created attachment 74230 [details]
Database with two undeletable tables

The attached kexi-db contains two tables I managed to import (see bug #307575) from the db attached to bug #307571.
Comment 3 Jarosław Staniek 2012-10-04 22:35:07 UTC
Git commit 6e43601ab185afbbab8d18e78bf73214a17c3e64 by Jaroslaw Staniek.
Committed on 04/10/2012 at 22:13.
Pushed by staniek into branch 'calligra/2.5'.

Fix the lowercase fix and db import

KexiDB
*A fix for the lowercase fix: keep table names in original format but compare them in case-insensitive way when needed
**This way importing from databases with tables upper-case characters works

Migration
*Fix invalid SQL generation for database import
*Fix importing from databases with tables upper-case characters
Related: bug 306523
REVIEW:106726

M  +5    -11   kexi/core/kexiproject.cpp
M  +14   -11   kexi/kexidb/connection.cpp
M  +1    -1    kexi/kexidb/expression.cpp
M  +1    -1    kexi/kexidb/tableschema.cpp
M  +26   -24   kexi/migration/keximigrate.cpp
M  +4    -3    kexi/migration/mysql/mysqlmigrate.cpp

http://commits.kde.org/calligra/6e43601ab185afbbab8d18e78bf73214a17c3e64
Comment 4 Jarosław Staniek 2012-10-04 22:35:59 UTC
Git commit 420a12d13746f5d5cebd9a10d140fd66b141ab59 by Jaroslaw Staniek.
Committed on 04/10/2012 at 22:13.
Pushed by staniek into branch 'master'.

Fix the lowercase fix and db import

KexiDB
*A fix for the lowercase fix: keep table names in original format but compare them in case-insensitive way when needed
**This way importing from databases with tables upper-case characters works

Migration
*Fix invalid SQL generation for database import
*Fix importing from databases with tables upper-case characters
Related: bug 306523

M  +5    -11   kexi/core/kexiproject.cpp
M  +26   -24   kexi/migration/keximigrate.cpp
M  +4    -3    kexi/migration/mysql/mysqlmigrate.cpp
M  +14   -11   libs/db/connection.cpp
M  +1    -1    libs/db/expression.cpp
M  +1    -1    libs/db/tableschema.cpp

http://commits.kde.org/calligra/420a12d13746f5d5cebd9a10d140fd66b141ab59
Comment 5 Jarosław Staniek 2012-10-04 22:37:52 UTC
Importing issues have been fixed too by the way.
Comment 6 Jarosław Staniek 2012-10-04 23:44:49 UTC
Git commit c8d4eb10b5d8256c74c02a54d313ceb5ce5db671 by Jaroslaw Staniek.
Committed on 04/10/2012 at 22:13.
Pushed by staniek into branch 'kexi-altertable-staniek'.

Fix the lowercase fix and db import

KexiDB
*A fix for the lowercase fix: keep table names in original format but compare them in case-insensitive way when needed
**This way importing from databases with tables upper-case characters works

Migration
*Fix invalid SQL generation for database import
*Fix importing from databases with tables upper-case characters
Related: bug 306523

M  +5    -11   kexi/core/kexiproject.cpp
M  +26   -24   kexi/migration/keximigrate.cpp
M  +4    -3    kexi/migration/mysql/mysqlmigrate.cpp
M  +11   -8    libs/db/connection.cpp
M  +1    -1    libs/db/expression.cpp
M  +1    -1    libs/db/tableschema.cpp

http://commits.kde.org/calligra/c8d4eb10b5d8256c74c02a54d313ceb5ce5db671
Comment 7 Jarosław Staniek 2013-11-11 23:28:55 UTC
Git commit 676b32b8e2f506721ce3b6573f51673b84ba998c by Jaroslaw Staniek.
Committed on 23/10/2013 at 20:20.
Pushed by staniek into branch 'master'.

Fix of handling case sensitivity of object names

*A fix for the lowercase fix: keep table names in original format but compare them in case-insensitive way when needed
**This way importing from databases with tables upper-case characters works
Related: bug 306523

from Calligra master 420a12d13746f5d5ce

M  +14   -10   Predicate/Connection.cpp
M  +1    -1    Predicate/TableSchema.cpp
M  +0    -1    Predicate/expression/VariableExpression.cpp

http://commits.kde.org/predicate/676b32b8e2f506721ce3b6573f51673b84ba998c