[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdesupport/akonadi/server
From:       Tobias Koenig <tokoe () kde ! org>
Date:       2010-07-13 13:38:36
Message-ID: 20100713133836.F3F76AC867 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1149443 by tokoe:

Fix sql generation for odbc


 M  +8 -20     src/storage/dbinitializer.cpp  
 M  +1 -1      tests/unittest/dbinitializertest_data/odbc_ct_collection  
 M  +1 -1      tests/unittest/dbinitializertest_data/odbc_ct_collectionattribute  
 M  +1 -1      tests/unittest/dbinitializertest_data/odbc_ct_flag  
 M  +1 -1      tests/unittest/dbinitializertest_data/odbc_ct_mimetype  
 M  +1 -1      tests/unittest/dbinitializertest_data/odbc_ct_part  
 M  +1 -1      tests/unittest/dbinitializertest_data/odbc_ct_pimitem  
 M  +1 -1      tests/unittest/dbinitializertest_data/odbc_ct_resource  


--- trunk/kdesupport/akonadi/server/src/storage/dbinitializer.cpp #1149442:1149443
@@ -162,9 +162,16 @@
             props.append( QLatin1Char( ' ' ) );
           props.append( QLatin1String( "PRIMARY KEY" ) );
         }
-        if ( entry.second.contains( QLatin1String("BINARY") ) )
+        if ( entry.second.contains( QLatin1String("BINARY") ) ) {
           entry.second.remove(QLatin1String("BINARY"));
       }
+        if ( entry.second.contains(QLatin1String("character set utf8 collate \
utf8_bin")) ) { +          entry.second.remove(QLatin1String("character set utf8 \
collate utf8_bin")); +        }
+        // virtuoso does not support default on timestamp and identity
+        if ( entry.second.contains( QLatin1String("CURRENT_TIMESTAMP") ) )
+          entry.second.remove(QLatin1String("DEFAULT CURRENT_TIMESTAMP") ); 
+      }
       // special cases for PostgreSQL
       if ( mDatabase.driverName() == QLatin1String( "QPSQL" ) ) {
         if ( columnElement.attribute( QLatin1String( "isAutoIncrement" ) ) == \
QLatin1String( "true" ) && @@ -199,25 +206,6 @@
         if ( entry.second.startsWith( QLatin1String("CHAR") ) )
           entry.second.replace(QLatin1String("CHAR"), QLatin1String("VARCHAR"));
       }
-      // special cases for Virtuoso
-      else if ( mDatabase.driverName().startsWith( QLatin1String("QODBC") ) ) {
-        if ( columnElement.attribute( QLatin1String( "isAutoIncrement" ) ) == \
                QLatin1String( "true" ) ) {
-          if ( !props.isEmpty() )
-            props.append( QLatin1Char( ' ' ) );
-          props.append( QLatin1String( "AUTOINCREMENT" ) );
-        }
-        if ( columnElement.attribute( QLatin1String( "isPrimaryKey" ) ) == \
                QLatin1String( "true" ) ) {
-          if ( !props.isEmpty() )
-            props.append( QLatin1Char( ' ' ) );
-          props.append( QLatin1String( "PRIMARY KEY" ) );
-        }
-        if ( entry.second.contains(QLatin1String("character set utf8 collate \
                utf8_bin")) ) {
-          entry.second.remove(QLatin1String("character set utf8 collate utf8_bin"));
-        }
-        // virtuoso does not support default on timestamp and identity
-        if ( entry.second.contains( QLatin1String("CURRENT_TIMESTAMP") ) )
-          entry.second.remove(QLatin1String("DEFAULT CURRENT_TIMESTAMP") ); 
-      }
       entry.second += QLatin1String(" ") + props;
 
       if ( !columnElement.attribute( QLatin1String( "refTable" ) ).isEmpty()
--- trunk/kdesupport/akonadi/server/tests/unittest/dbinitializertest_data/odbc_ct_collection \
#1149442:1149443 @@ -1,4 +1,4 @@
-CREATE TABLE CollectionTable (id BIGINT NOT NULL IDENTITY PRIMARY KEY AUTOINCREMENT \
PRIMARY KEY, +CREATE TABLE CollectionTable (id BIGINT NOT NULL IDENTITY PRIMARY KEY,
                               remoteId VARCHAR(255),
                               remoteRevision VARCHAR(255),
                               name VARCHAR(255) BINARY character set utf8 collate \
                utf8_bin NOT NULL,
--- trunk/kdesupport/akonadi/server/tests/unittest/dbinitializertest_data/odbc_ct_collectionattribute \
#1149442:1149443 @@ -1,4 +1,4 @@
-CREATE TABLE CollectionAttributeTable (id BIGINT NOT NULL IDENTITY PRIMARY KEY \
AUTOINCREMENT PRIMARY KEY, +CREATE TABLE CollectionAttributeTable (id BIGINT NOT NULL \
                IDENTITY PRIMARY KEY,
                                        collectionId BIGINT NOT NULL REFERENCES \
CollectionTable(id) ON DELETE CASCADE ON UPDATE CASCADE,  type LONG VARCHAR NOT NULL,
                                        value LONG VARCHAR)
--- trunk/kdesupport/akonadi/server/tests/unittest/dbinitializertest_data/odbc_ct_flag \
#1149442:1149443 @@ -1,2 +1,2 @@
-CREATE TABLE FlagTable (id BIGINT NOT NULL IDENTITY PRIMARY KEY AUTOINCREMENT \
PRIMARY KEY, +CREATE TABLE FlagTable (id BIGINT NOT NULL IDENTITY PRIMARY KEY,
                         name VARCHAR(255) NOT NULL UNIQUE)
--- trunk/kdesupport/akonadi/server/tests/unittest/dbinitializertest_data/odbc_ct_mimetype \
#1149442:1149443 @@ -1,2 +1,2 @@
-CREATE TABLE MimeTypeTable (id BIGINT NOT NULL IDENTITY PRIMARY KEY AUTOINCREMENT \
PRIMARY KEY, +CREATE TABLE MimeTypeTable (id BIGINT NOT NULL IDENTITY PRIMARY KEY,
                             name VARCHAR(255) NOT NULL UNIQUE)
--- trunk/kdesupport/akonadi/server/tests/unittest/dbinitializertest_data/odbc_ct_part \
#1149442:1149443 @@ -1,4 +1,4 @@
-CREATE TABLE PartTable (id BIGINT NOT NULL IDENTITY PRIMARY KEY AUTOINCREMENT \
PRIMARY KEY, +CREATE TABLE PartTable (id BIGINT NOT NULL IDENTITY PRIMARY KEY,
                         pimItemId BIGINT NOT NULL REFERENCES PimItemTable(id) ON \
DELETE CASCADE ON UPDATE CASCADE,  name VARCHAR(255) NOT NULL,
                         data LONG VARCHAR,
--- trunk/kdesupport/akonadi/server/tests/unittest/dbinitializertest_data/odbc_ct_pimitem \
#1149442:1149443 @@ -1,4 +1,4 @@
-CREATE TABLE PimItemTable (id BIGINT NOT NULL IDENTITY PRIMARY KEY AUTOINCREMENT \
PRIMARY KEY, +CREATE TABLE PimItemTable (id BIGINT NOT NULL IDENTITY PRIMARY KEY,
                            rev INTEGER NOT NULL DEFAULT 0,
                            remoteId VARCHAR(255),
                            remoteRevision VARCHAR(255),
--- trunk/kdesupport/akonadi/server/tests/unittest/dbinitializertest_data/odbc_ct_resource \
#1149442:1149443 @@ -1,3 +1,3 @@
-CREATE TABLE ResourceTable (id BIGINT NOT NULL IDENTITY PRIMARY KEY AUTOINCREMENT \
PRIMARY KEY, +CREATE TABLE ResourceTable (id BIGINT NOT NULL IDENTITY PRIMARY KEY,
                             name VARCHAR(255) NOT NULL UNIQUE,
                             isVirtual CHAR DEFAULT 0)


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic