Home » U++ Library support » U++ SQL » SQLITE: remove case sensitive of column type name.
SQLITE: remove case sensitive of column type name. [message #26665] |
Tue, 18 May 2010 17:25 |
|
Hello all,
I propose to remove case sensitive of column type name.
I prepared a little patch for this:
Index: uppsrc/plugin/sqlite3/Sqlite3upp.cpp
===================================================================
--- uppsrc/plugin/sqlite3/Sqlite3upp.cpp (revision 2404)
+++ uppsrc/plugin/sqlite3/Sqlite3upp.cpp (working copy)
@@ -245,7 +245,8 @@
}
ASSERT(got_row_data);
- String coltype = sqlite3_column_decltype(current_stmt,i);
+ // Remove case sensitive
+ String coltype = ToLower(sqlite3_column_decltype(current_stmt,i));
switch (sqlite3_column_type(current_stmt,i)) {
case SQLITE_INTEGER:
f = sqlite3_column_int64(current_stmt,i);
It is useful when I create a table
"CREATE TABLE Tab1(col1 DATETIME)".
When i execute a select statement, the conversion in Time is not correct.
|
|
|
|
Re: SQLITE: remove case sensitive of column type name. [message #26768 is a reply to message #26665] |
Wed, 26 May 2010 17:25 |
Novo
Messages: 1371 Registered: December 2006
|
Ultimate Contributor |
|
|
tojocky wrote on Tue, 18 May 2010 11:25 | Hello all,
I propose to remove case sensitive of column type name.
I prepared a little patch for this:
Index: uppsrc/plugin/sqlite3/Sqlite3upp.cpp
===================================================================
--- uppsrc/plugin/sqlite3/Sqlite3upp.cpp (revision 2404)
+++ uppsrc/plugin/sqlite3/Sqlite3upp.cpp (working copy)
@@ -245,7 +245,8 @@
}
ASSERT(got_row_data);
- String coltype = sqlite3_column_decltype(current_stmt,i);
+ // Remove case sensitive
+ String coltype = ToLower(sqlite3_column_decltype(current_stmt,i));
switch (sqlite3_column_type(current_stmt,i)) {
case SQLITE_INTEGER:
f = sqlite3_column_int64(current_stmt,i);
It is useful when I create a table
"CREATE TABLE Tab1(col1 DATETIME)".
When i execute a select statement, the conversion in Time is not correct.
|
There is a bug in this patch. sqlite3_column_decltype() can return NULL. ToLower() will crash in this case because it will call strlen(NULL).
I already met this problem in my app.
Regards,
Novo
|
|
|
Re: SQLITE: remove case sensitive of column type name. [message #26796 is a reply to message #26768] |
Fri, 28 May 2010 14:55 |
|
mirek
Messages: 14112 Registered: November 2005
|
Ultimate Member |
|
|
Novo wrote on Wed, 26 May 2010 11:25 |
tojocky wrote on Tue, 18 May 2010 11:25 | Hello all,
I propose to remove case sensitive of column type name.
I prepared a little patch for this:
Index: uppsrc/plugin/sqlite3/Sqlite3upp.cpp
===================================================================
--- uppsrc/plugin/sqlite3/Sqlite3upp.cpp (revision 2404)
+++ uppsrc/plugin/sqlite3/Sqlite3upp.cpp (working copy)
@@ -245,7 +245,8 @@
}
ASSERT(got_row_data);
- String coltype = sqlite3_column_decltype(current_stmt,i);
+ // Remove case sensitive
+ String coltype = ToLower(sqlite3_column_decltype(current_stmt,i));
switch (sqlite3_column_type(current_stmt,i)) {
case SQLITE_INTEGER:
f = sqlite3_column_int64(current_stmt,i);
It is useful when I create a table
"CREATE TABLE Tab1(col1 DATETIME)".
When i execute a select statement, the conversion in Time is not correct.
|
There is a bug in this patch. sqlite3_column_decltype() can return NULL. ToLower() will crash in this case because it will call strlen(NULL).
I already met this problem in my app.
|
Yes, unforseen consequences, should have been patched already.
|
|
|
Goto Forum:
Current Time: Sun Nov 10 20:50:46 CET 2024
Total time taken to generate the page: 0.01912 seconds
|