[erlang-bugs] [Fwd: Re: odbc:param_query]

Ingela Anderton Andin <>
Wed May 7 09:34:09 CEST 2008


Anders Nygren wrote:
> On Mon, May 5, 2008 at 8:01 AM, Anders Nygren <> wrote:
>   
>> 2008/5/5 Ingela Anderton Andin <>:
>>
>>     
>>  >
>>  > Hi!
>>  >
>>  >  As a part of bigger patch (for 64 bit-odbc) I got the following change to
>>  > param-queries in odbcserver.c. This might help your case, it would
>>  >  be great if you could try that out for me.  I am not very found of the ODBC
>>  > API (or the implementations of it anyway) it does surprising things
>>  >  at times.
>>  >
>>
>>  Hi Ingela
>>  After a quick test, it looks like it is working fine with the patch.
>>  Thanks a lot.
>>
>>  /Anders
>>     
>
> After some more testing I have seen that the problem remains.
>
>   

Humm... could you be a little more specific?  I guess that the problem 
still occurs but
not as often?! (As you seemed to think that it helped at first.) Maybe 
there are more special
cases that occur with the use of some drivers but not others.  Alas we 
can not test with all existing
drivers and all existing backends.  We test with the databases
SQLServer on windows systems and Postgress on unix systems.  When I get
time I will try to test with the table you supplied below in our 
environment.  But if the problem
is driver specific it might work just fine. (Our existing test on 
param-queries does.)
Just a few questions, does it fail in a predictably way? Always the n:th 
time you try or after you did something
elese or does it seem to be random? It would be good to have a minimal 
test case to provoke the error.
Setting up a mysql-environment will however not be a top priority for us.
In the meantime if you  should  stumble on some solution  yourself we 
will of course accept patches a as long as they do not
break anything else and seem reasonable.

Regards Ingela, Erlang/OTP Ericsson
>>
>>  >  @@ -760,6 +758,7 @@ static db_result_msg db_param_query(byte *buffer,
>>  > db_state *state)
>>  >         switch (param_status.param_status_array[i]) {
>>  >         case SQL_PARAM_SUCCESS:
>>  >         case SQL_PARAM_SUCCESS_WITH_INFO:
>>  >  +        case SQL_PARAM_DIAG_UNAVAILABLE:
>>  >         break;
>>  >         default:
>>  >             diagnos =
>>  >
>>  >
>>  >  Regards Ingela - OTP team
>>  >
>>  >  Anders Nygren wrote:
>>  >
>>  > > I am having a problem with parameterized queries
>>  > > Erlang R12B-2 on Linux (SuSE 10.3)
>>  > > MySQL 5.0.45
>>  > > myodbc 3.51
>>  > > unixODBC 2.2.12
>>  > >
>>  > >
>>  > > Reply = odbc:param_query(State#state.cref,
>>  > >                             "insert into Users (userId, password, "
>>  > >                             "userType, name) values (?,?,?,?)",
>>  > >                             [{{sql_varchar,20},[UserId]},
>>  > >                              {{sql_varchar,20},[Passwd]},
>>  > >                              {{sql_char,6},[Type]},
>>  > >                              {{sql_varchar,100},[Name]}]),
>>  > >
>>  > >
>>  > > Sometimes I get {updated, 1}, but most of the time I get the following
>>  > error
>>  > > {error,"No SQL-driver information available."} but the data has been
>>  > inserted.
>>  > >
>>  > > The table is created with
>>  > > CREATE  TABLE IF NOT EXISTS `npas`.`Users` (
>>  > >  `userId` VARCHAR(20) NOT NULL ,
>>  > >  `password` VARCHAR(20) NOT NULL ,
>>  > >  `userType` ENUM('admin','normal','read') NOT NULL ,
>>  > >  `name` VARCHAR(100) NOT NULL ,
>>  > >  PRIMARY KEY (`userId`) )
>>  > > ENGINE = InnoDB
>>  > > PACK_KEYS = 0
>>  > > ROW_FORMAT = DEFAULT;
>>  > > _______________________________________________
>>  > > erlang-bugs mailing list
>>  > > 
>>  > > http://www.erlang.org/mailman/listinfo/erlang-bugs
>>  > >
>>  > >
>>  > >
>>  >
>>  >
>>  >
>>  > _______________________________________________
>>  >  erlang-bugs mailing list
>>  >  
>>  >  http://www.erlang.org/mailman/listinfo/erlang-bugs
>>  >
>>
>>     
>
>   




More information about the erlang-bugs mailing list