[SqueakDBX] Re: Re[2]: [opendbx] Should MySQL 4.0.15. work with OpenDBX ?

Mariano Martinez Peck marianopeck at gmail.com
Wed Sep 30 02:40:12 UTC 2009


On Tue, Sep 29, 2009 at 6:41 PM, Mariano Martinez Peck <
marianopeck at gmail.com> wrote:

>
>
> 2009/9/29 Mariano Martinez Peck <marianopeck at gmail.com>
>
>>
>>
>> 2009/9/29 Herbert König <herbertkoenig at gmx.net>
>>
>>> Hello Mariano Norbert,
>>>
>>> wouldn't the cheapest way be to just build a special case into
>>> SqueakDBX error handling that could be activated via some option?
>>>
>>>
>> This, this can be perfectly done (I think). I also have thought in this
>> solution. I will review the code and commit a version so that you can test
>> it.
>>
>> The thing is that I don't know what happens if you open a connection with
>> this error. What happens with all of the queries you do then ? will them
>> work?
>>
>
> Can you put a breakpoint in DBXPlatform>>errorCode:handle:
>
> And then when you have the error "unknown system variable" debug it and
> tell me the values of  "err" and "description" please ?
>
>

Ok, I see two solutions here, but both or them sucks. I hope I could get a
better error handling for OpenDBX (I am sending emails with Norbert in
openDBX mailing list about this).

"Solution 1"  Change in DBXPlatform>>openConnection:

this


    self
        verifyError: err
        handle: aConnection handle.


for this:

[   self
        verifyError: err
        handle: aConnection handle.]  on: DBXRecoverableError do: [ : ex |
"nothing"].


What you do here is to handle ALL of the possible recoverable errors when
trying to open a connection and do nothing when they occur.


"Solition 2"

Change the same piece of code for this:

[   self
        verifyError: err
        handle: aConnection handle.]  on: DBXRecoverableError do: [ : ex | (
ex description = 'unknown system variable.....' ) ifTrue: [ "nothing" ]
                   ifFalse: [ ex signal ] ].

What you do here is: if the description of the error is that, you do
nothing. On other cases, you signal the same exception again.

If this 2nd solution works, what we can do, at least, is to override the
method openConnection in DBXMySQLPlatform and put this change there. This is
the idea of having the subclasses.

I am sorry I know this is crap but I think I cannot get an id, number or
something from OpenDBX to identify a particular error. I suggest you join
OpenDBX mailing list and see my discussion with Norbert.

Best,

Mariano


Cheers,
>
> Mariano
>
>
>
>>
>> It's a recoverable error after all.
>>>
>>> Same for OpenDBX, couldn't it just be an option? Me talking about
>>> something I know nothing about.
>>>
>>> And about supporting an extra built I'd say it's a pain that isn't
>>> worth it. (Talking about something I know). So it can either be a
>>> parameter in OpenDBX or it can be done in SqueakDBX.
>>>
>>>
>> ok.
>>
>>
>>> As time permits I will try a port to see if I find more problems than
>>> the recoverable connection error.
>>>
>>> I will let you know.
>>>
>>>
>> Thanks.
>>
>>
>>>
>>> Thanks
>>>
>>> Herbert
>>> MMP> 2009/9/29 Mariano Martinez Peck <marianopeck at gmail.com>
>>>
>>>
>>> MMP> 2009/9/29 Norbert Sendetzky <norbert at linuxnetworks.de>
>>>
>>> MMP> Hi Mariano, Herbert
>>>
>>> >> Ok. Now it is almost working. He is using the MySQL 5 client library
>>> to
>>> >>  talk to a MySQL 4.0.15 server. I saw this:
>>> >>
>>>
>>> >> The problem now is that when he is trying to open the connection
>>> >>  (odbx_bind) he gets a "unknown system variable "sql_mode"".
>>> >> I looked in OpenDBX code and you don't have "sql_mode" in your source
>>> code.
>>>
>>>
>>> MMP> It's in backends/mysql/mysql_basic.c, line 761 (trunk)
>>>
>>>
>>>
>>>
>>> MMP> Wow....my total commander didn't find it....weird :(
>>> MMP>
>>>
>>> MMP> Unfortunately, sql_mode is only supported since 4.1, so it's not
>>> possible to
>>> MMP> connect to a MySQL 4.0 server using the standard OpenDBX source. The
>>> only way
>>> MMP> to use the library would be to comment out the call to
>>> mysql_priv_setmode() in
>>> MMP> line 197 and recompile but this would require to start the MySQL
>>> server in
>>> MMP> ANSI mode (--sql-mode=ANSI) to get the same behaviour.
>>>
>>>
>>>
>>>
>>>
>>> MMP> Thanks for the explanation Norbert. Now I am intrigued why
>>> MMP> OpenDBX needs to set something in that variable. I mean, what
>>> MMP> happens if you remove that call in line 197?
>>>
>>>
>>>
>>>
>>>
>>>
>>> MMP> Herbert if you want, I can compile a new dll with the
>>> MMP> changes Norbert said justto see if it works. Then you can decide
>>> MMP> if you want to use SqueakDBX orthe native driver :(
>>>
>>> MMP> For every new release of OpenDBX I can create a special
>>> MMP> MySQL dll for4.0x MySQL compatibility. I have no problem at all
>>> MMP> doing that. It isjust a couple of minutes.
>>>
>>> MMP> Norbert: if this changes work, what do you think in
>>> MMP> including to the website a MySQL-4.0x special dll for every new
>>> MMP> release?
>>>
>>> MMP> Best,
>>>
>>> MMP> mariano
>>>
>>> MMP>
>>> MMP> Cheers,
>>>
>>> MMP> Mariano
>>> MMP>
>>>
>>> MMP> Norbert
>>> MMP> --
>>> MMP> OpenPGP public key
>>> MMP> http://www.linuxnetworks.de/norbert.pubkey.asc
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> Thanks,
>>>
>>> Herbert                            mailto:herbertkoenig at gmx.net
>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeakdbx/attachments/20090929/5ed3fb8c/attachment.htm


More information about the SqueakDBX mailing list