ISQL Buffer corruption under Solaris 10, SPARC 64

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

ISQL Buffer corruption under Solaris 10, SPARC 64

by Romain GUINOT :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi all,

I'm encountering what seems to be a bug either with unixODBC or Solaris libraries.
I cannot execute queries longer than 255 characters. if i do, the first 255 characters are dropped and only the rest of the query remains, resulting in errors...

I tried looking a the 2.2.12 code, but my C days are a bit old, and i can't seem to find a reason why it fails...

I've added this section in my odbcinst.ini :
[ODBC]
Trace           = Yes
TraceFile               = /tmp/odbc-sql.log
ForceTrace              = Yes
Pooling         = No


to obtain a trace.

I can see that my query is already chopped when it comes trough SQLPrepare.c in the driver manager (only the remainder of the query after 255  characters is left):

[ODBC][13998][SQLPrepare.c][193]
                Entry:            
                        Statement = 387f8            
                        SQL = [s from  r_resc_main; ][length = 21 (SQL_NTS)]

if i execute a shorter query ,

[ODBC][13977][SQLPrepare.c][193]
                Entry:            
                        Statement = 387f8            
                        SQL = [select distinct r_resc_main.resc_id  ,r_resc_main.zone_name ,r_resc_main.resc_type_name ,r_resc_main.resc_class_name ,r_resc_mai...][length = 232 (SQL_NTS)]

it behaves correctly.

Do you have an idea what might cause the problem ?  

my current isql binary is linked against libreadline.so.5 and libcurses.so.1 among others, and built with gcc 3.4 bundled with solaris 10.


Re: ISQL Buffer corruption under Solaris 10, SPARC 64

by Nick Gorham :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Romain GUINOT wrote:

>Hi all,
>
>I'm encountering what seems to be a bug either with unixODBC or Solaris
>libraries.
>I cannot execute queries longer than 255 characters. if i do, the first 255
>characters are dropped and only the rest of the query remains, resulting in
>errors...
>
>I tried looking a the 2.2.12 code, but my C days are a bit old, and i can't
>seem to find a reason why it fails...
>
>I've added this section in my odbcinst.ini :
>[ODBC]
>Trace           = Yes
>TraceFile               = /tmp/odbc-sql.log
>ForceTrace              = Yes
>Pooling         = No
>
>
>  
>
I can't think of a reason why it would do that. Things to try would be
building isql without readline support to see if there is a problem
there, and try the -s option to isql to increase the buffer size, but it
should default to more that 255 characters.

--
Nick Gorham
Easysoft Limited
http://www.easysoft.com, http://www.unixODBC.org

_______________________________________________
unixODBC-support mailing list
unixODBC-support@...
http://mail.easysoft.com/mailman/listinfo/unixodbc-support

Re: ISQL Buffer corruption under Solaris 10, SPARC 64

by Romain GUINOT :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

>I can't think of a reason why it would do that. Things to try would be
> building isql without readline support to see if there is a problem
> there, and try the -s option to isql to increase the buffer size, but it
> should default to more that 255 characters.
I'll be checking this out now.. This was on my list of things to check.
I'll let you know if it works better.

Best Regards,

Re: ISQL Buffer corruption under Solaris 10, SPARC 64

by Romain GUINOT :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Romain GUINOT wrote:
>I can't think of a reason why it would do that. Things to try would be
> building isql without readline support to see if there is a problem
> there, and try the -s option to isql to increase the buffer size, but it
> should default to more that 255 characters.
I'll be checking this out now.. This was on my list of things to check.
I'll let you know if it works better.

Best Regards,
Hi,
I have just found out that the problem arises from Solaris's libc !
Just doing :

root@test2:[/opt/unixODBC-2.2.12/exe]# wc
select 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa';       0       1       9

shows that the string is corrupted :(
Anyone aware of the problem ?