[Gambas-devel] Database Component

Nigel Gerrard nigel at ...2...
Wed Apr 14 13:01:07 CEST 2004


Benoit,

I've found out that field names are indeed "not case sensative" in mysql,
but table names and database names may be.
In sqlite, table names and field names are case in sensative so it is an
issue with each of the drivers.  I will correct this amongst all
the other changes and pass to you.

Nigel

----- Original Message ----- 
From: "Benoit Minisini" <gambas at ...1...>
To: <gambas-devel at lists.sourceforge.net>
Sent: Friday, April 09, 2004 9:29 PM
Subject: Re: [Gambas-devel] Database Component


> On Tuesday 06 April 2004 17:59, Nigel Gerrard wrote:
> > Benoit,
> >
> > I have been making some changes to the database drivers and will submit
> > them later when complete, but I have noticed some strange behavour in
what
> > I believe to to be the interpreter.
> >
> > If you create a table thus:
> >
> > create table test ( id integer not null, name test , primary key (id));
> >
> > Then populate with a couple of records.
> >
> > insert into test ( 1, 'fred');
> > insert into test ( 2, 'sid');
> >
> > Next create a gambas program to edit one of the records.
> >
> > .
> > .
> > .
> > DIM rTest AS Result
> > .
> > .
> > rTest = $hConn.Edit("test","id = 2")
> > FOR EACH rTest.Field
> >     PRINT rTest.Field.Name
> > NEXT
> >
> > PRINT rTest!id & ":" & rTest!name
> > rTest!name = "sidney"
> > rTest.Update
> >
> >
> > Now run with the MySQL and Sqlite drivers and you get:
> >
> > id
> > name
> > ...... #-1: Unknown field: Name
> >
> > With postgresql you get what you would expect:
> > id
> > name
> > 2:sid
> >
> > You might think that this is a problem only with the two drivers, but if
> > you print the the paramater name being handed to field_index in main.c
you
> > will see that the value is 'Name' and not 'name' and it is only because
> > postgresql  is non case-sensative that it too doesn't fail.
> >
> > My belief is that during parsing, the token Name is mistaken for name.
> >
> > Nigel
>
> Maybe the compiler use "Name" because of the first occurrence of name.
This
> could be seen as a bug :-)
>
> But I think the database component should be case insensitive. By forcing
> field names to lowercase for example. What do you think about that ?
>
> Regards,
>
> -- 
> Benoit Minisini
> mailto:gambas at ...1...
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: IBM Linux Tutorials
> Free Linux tutorial presented by Daniel Robbins, President and CEO of
> GenToo technologies. Learn everything from fundamentals to system
> administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
> _______________________________________________
> Gambas-devel mailing list
> Gambas-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-devel





More information about the Devel mailing list