Bug in Database manager

View: New views
6 Messages — Rating Filter:   Alert me  

Bug in Database manager

by kobolds :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

gambas 2.14
database sqlite

I create table with 2 datetime fields (start_date , end_date) and default value current_timestamp . and 1 string field (stg_status) with default 'O'

when I open using gambas database manager
the 2 datetime field show ,
start_date --> default show --> 0
end_date---> default show --> 8980056

the string field stg_status --> default show --> 4.444578977261E-317

I also found very strange limitation in database manager . if you manual create a table from sqlite konsole . if you type like this :
create table testtbl( std_id integer primary key autoincrement , std_name text);

sqlite execute no problem but when you open using database manager , it give error no primary key

you must type
create table testtbl( 'std_id' INTEGER PRIMARY KEY AUTOINCREMENT , 'std_name' TEXT);

why such weird limitation exist ?

Re: Bug in Database manager

by Benoît Minisini :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> gambas 2.14
> database sqlite
>
> I create table with 2 datetime fields (start_date , end_date) and default
> value current_timestamp . and 1 string field (stg_status) with default 'O'
>
> when I open using gambas database manager
> the 2 datetime field show ,
> start_date --> default show --> 0
> end_date---> default show --> 8980056
>
> the string field stg_status --> default show --> 4.444578977261E-317
>
> I also found very strange limitation in database manager . if you manual
> create a table from sqlite konsole . if you type like this :
> create table testtbl( std_id integer primary key autoincrement , std_name
> text);
>
> sqlite execute no problem but when you open using database manager , it
> give error no primary key
>
> you must type
> create table testtbl( 'std_id' INTEGER PRIMARY KEY AUTOINCREMENT ,
> 'std_name' TEXT);
>
> why such weird limitation exist ?

You must create your tables from the database manager if you want him to
display them reliably. As there is no standard way in SQL to store metadata in
a database, the gambas database component relies on specific database-
dependant datatype to do its mapping with Gambas native datatypes.

See http://gambasdoc.org/help/doc/db-type-mapping for more details.

In your specific case, I think there is a case-sensitive comparison somewhere
in the sqlite database driver that should be case-unsensitive. I will
investigate and try to fix the problem.

Regards,

--
Benoît

------------------------------------------------------------------------------
_______________________________________________
Gambas-user mailing list
Gambas-user@...
https://lists.sourceforge.net/lists/listinfo/gambas-user

Re: Bug in Database manager

by kobolds :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Benoît Minisini wrote:
> gambas 2.14
> database sqlite
>
> I create table with 2 datetime fields (start_date , end_date) and default
> value current_timestamp . and 1 string field (stg_status) with default 'O'
>
> when I open using gambas database manager
> the 2 datetime field show ,
> start_date --> default show --> 0
> end_date---> default show --> 8980056
>
> the string field stg_status --> default show --> 4.444578977261E-317
>
> I also found very strange limitation in database manager . if you manual
> create a table from sqlite konsole . if you type like this :
> create table testtbl( std_id integer primary key autoincrement , std_name
> text);
>
> sqlite execute no problem but when you open using database manager , it
> give error no primary key
>
> you must type
> create table testtbl( 'std_id' INTEGER PRIMARY KEY AUTOINCREMENT ,
> 'std_name' TEXT);
>
> why such weird limitation exist ?

You must create your tables from the database manager if you want him to
display them reliably. As there is no standard way in SQL to store metadata in
a database, the gambas database component relies on specific database-
dependant datatype to do its mapping with Gambas native datatypes.

See http://gambasdoc.org/help/doc/db-type-mapping for more details.

In your specific case, I think there is a case-sensitive comparison somewhere
in the sqlite database driver that should be case-unsensitive. I will
investigate and try to fix the problem.

Regards,

--
Benoît

------------------------------------------------------------------------------
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

what I mention is also happen when you using the database manager to create the table and the default value . this  happen if the field type is string .  
create a table (sqlite) using database manager . create a field type string . enter the default value 'O' .save . refresh /reload . the default value for the string change to number (the number change each time you open the database manager).  

if you check the schema of the table from sqlite konsole , it show correct the default 'O' .

if you want to enter data into the table using database manager you will see default (random number) field into it rather than 'O' .





Re: Bug in Database manager

by Benoît Minisini :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

>
> what I mention is also happen when you using the database manager to create
> the table and the default value . this  happen if the field type is string
> . create a table (sqlite) using database manager . create a field type
> string . enter the default value 'O' .save . refresh /reload . the default
> value for the string change to number (the number change each time you open
> the database manager).
>
> if you check the schema of the table from sqlite konsole , it show correct
> the default 'O' .
>
> if you want to enter data into the table using database manager you will
> see default (random number) field into it rather than 'O' .

Ah, okay! I will investigate...

--
Benoît

------------------------------------------------------------------------------
_______________________________________________
Gambas-user mailing list
Gambas-user@...
https://lists.sourceforge.net/lists/listinfo/gambas-user

Re: Bug in Database manager

by Benoît Minisini :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> > what I mention is also happen when you using the database manager to
> > create the table and the default value . this  happen if the field type
> > is string . create a table (sqlite) using database manager . create a
> > field type string . enter the default value 'O' .save . refresh /reload .
> > the default value for the string change to number (the number change each
> > time you open the database manager).
> >
> > if you check the schema of the table from sqlite konsole , it show
> > correct the default 'O' .
> >
> > if you want to enter data into the table using database manager you will
> > see default (random number) field into it rather than 'O' .
>
> Ah, okay! I will investigate...

Wow, two bugs mixed together! They should be fixed in revision #2083. If you
can test it and confirm the fix, it would be cool.

Regards,

--
Benoît

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize
details at: http://p.sf.net/sfu/blackberry
_______________________________________________
Gambas-user mailing list
Gambas-user@...
https://lists.sourceforge.net/lists/listinfo/gambas-user

Re: Bug in Database manager

by kobolds :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Benoît Minisini wrote:
> > what I mention is also happen when you using the database manager to
> > create the table and the default value . this  happen if the field type
> > is string . create a table (sqlite) using database manager . create a
> > field type string . enter the default value 'O' .save . refresh /reload .
> > the default value for the string change to number (the number change each
> > time you open the database manager).
> >
> > if you check the schema of the table from sqlite konsole , it show
> > correct the default 'O' .
> >
> > if you want to enter data into the table using database manager you will
> > see default (random number) field into it rather than 'O' .
>
> Ah, okay! I will investigate...

Wow, two bugs mixed together! They should be fixed in revision #2083. If you
can test it and confirm the fix, it would be cool.

Regards,

--
Benoît

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize
details at: http://p.sf.net/sfu/blackberry
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user
sorry I can't test cause  I never success compile gambas on my machine before .  I have to wait binary release.

I using opensuse 11.1 (x64) using gambas (x64) (by Guillermo Ballester Valor )