[Gambas-devel] Resend Database component

Nigel Gerrard nigel at ...2...
Tue Apr 6 18:25:18 CEST 2004


(Don't knowwhy there was an incomplete message last time)

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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/devel/attachments/20040406/02f75354/attachment.html>


More information about the Devel mailing list