[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bacula-devel] DBI, make_sqlite_table and make_sqlite3_table


I have a problem with libdbi and sqlite*

In libdbi driver for sqlite and sqlite3  CHAR columns are interpreted like
INTEGER values and CHAR( like TEXT. (only in sqlite and sqlite3 drivers)

This is a problem because in table Job, the column Level is CHAR. If I
store the value 'F', the libdbi driver will interpreted like the
number 70 because the type of column is CHAR. If the type of the
column is CHAR( the value will be interpreted correctly by dbi.

Attached to this email is a fix to make_sqlite_tables.in. I belive
this is inexpensive change in sqlite* schema.

Before, about seven regression tests failed to complete. After this
change only two failed.

Thanks..

-- 
-----------------------------------------------------------
João Henrique Freitas - joaohf_at_gmail.com
Campinas-SP-Brasil
BSD051283
LPI 1
http://www.joaohfreitas.eti.br
Index: make_sqlite3_tables.in
===================================================================
--- make_sqlite3_tables.in	(revision 7884)
+++ make_sqlite3_tables.in	(working copy)
@@ -51,10 +51,10 @@
    JobId INTEGER,
    Job VARCHAR(128) NOT NULL,
    Name VARCHAR(128) NOT NULL,
-   Type CHAR NOT NULL,
-   Level CHAR NOT NULL,
+   Type CHAR(1) NOT NULL,
+   Level CHAR(1) NOT NULL,
    ClientId INTEGER REFERENCES Client DEFAULT 0,
-   JobStatus CHAR NOT NULL,
+   JobStatus CHAR(1) NOT NULL,
    SchedTime DATETIME NOT NULL,
    StartTime DATETIME DEFAULT 0,
    EndTime DATETIME DEFAULT 0,
@@ -80,10 +80,10 @@
    JobId INTEGER,
    Job VARCHAR(128) NOT NULL,
    Name VARCHAR(128) NOT NULL,
-   Type CHAR NOT NULL,
-   Level CHAR NOT NULL,
+   Type CHAR(1) NOT NULL,
+   Level CHAR(1) NOT NULL,
    ClientId INTEGER REFERENCES Client DEFAULT 0,
-   JobStatus CHAR NOT NULL,
+   JobStatus CHAR(1) NOT NULL,
    SchedTime DATETIME NOT NULL,
    StartTime DATETIME DEFAULT 0,
    EndTime DATETIME DEFAULT 0,
Index: make_sqlite_tables.in
===================================================================
--- make_sqlite_tables.in	(revision 7884)
+++ make_sqlite_tables.in	(working copy)
@@ -51,10 +51,10 @@
    JobId INTEGER,
    Job VARCHAR(128) NOT NULL,
    Name VARCHAR(128) NOT NULL,
-   Type CHAR NOT NULL,
-   Level CHAR NOT NULL,
+   Type CHAR(1) NOT NULL,
+   Level CHAR(1) NOT NULL,
    ClientId INTEGER REFERENCES Client DEFAULT 0,
-   JobStatus CHAR NOT NULL,
+   JobStatus CHAR(1) NOT NULL,
    SchedTime DATETIME NOT NULL,
    StartTime DATETIME DEFAULT 0,
    EndTime DATETIME DEFAULT 0,
@@ -80,10 +80,10 @@
    JobId INTEGER,
    Job VARCHAR(128) NOT NULL,
    Name VARCHAR(128) NOT NULL,
-   Type CHAR NOT NULL,
-   Level CHAR NOT NULL,
+   Type CHAR(1) NOT NULL,
+   Level CHAR(1) NOT NULL,
    ClientId INTEGER REFERENCES Client DEFAULT 0,
-   JobStatus CHAR NOT NULL,
+   JobStatus CHAR(1) NOT NULL,
    SchedTime DATETIME NOT NULL,
    StartTime DATETIME DEFAULT 0,
    EndTime DATETIME DEFAULT 0,
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Bacula-devel mailing list
Bacula-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/bacula-devel


This mailing list archive is a service of Copilotco.