AltME: Databases

Messages

Will
the second one I really don't remember what it does.. :
-               either find port/locals/capabilities 'protocol-41 [
-                   insert-query port data
-               ][
+               ; either find port/locals/capabilities 'protocol-41 [
+               ;   insert-query port data
+               ; ][
                    insert-all-queries port data
-               ]
+               ; ]

Endo
Is there any way to insert a NULL using parametrized query?
mysql: first open odbc://mydns
insert mysql "create temporary table t (a int)"
insert mysql "insert into t values (NULL)"  ; this works
insert mysql ["insert into t values (?)" none]  ; this doesn't
** Script Error: ODBC error: [Microsoft][ODBC Driver Manager] Invalid string or buffer length
GiuseppeC
Hi Doc, is the mysql protocol R3 compatible ?
Endo
Protocol source is very clear, it looks like it might compatible with R3 or at least it can be with a little effort.
I'll get his to-sql function from the protocol source and use it to generate SQL of my parametrized query.

DocKimbel
@Giuseppe I never tried, usually low-level port-related code is AFAIK, not compatible between Rebol2 and 3.
That said, I guess it could be ported without much efforts by someone knowledgeable in R3's port coding.

Chris
Shixin has a Rebol 3 version: https://github.com/zsx/mysql-r3

GiuseppeC
Wow !

DideC
I need help with %mysql-protocol.r v1.3.0.
I use it nicely with a mysql 5.5.49.
But I tried to use it with a mysql 5.5.53 server (on a different machine), and I get an error at the opening of the port! :
DideC
REBOL/Core 2.7.8.4.10 (23-Jan-2016)
Copyright 2016 REBOL Technologies
REBOL is a Trademark of REBOL Technologies
All rights reserved.
Finger protocol loaded
Whois protocol loaded
Daytime protocol loaded
SMTP protocol loaded
ESMTP protocol loaded
POP protocol loaded
IMAP protocol loaded
HTTP protocol loaded
FTP protocol loaded
NNTP protocol loaded
>>
>> do %mysql-protocol.r
Script: "MySQL Protocol" (3-Dec-2008)
MySQL protocol loaded
>> trace/net on
>> open mysql://user:1Cuqb!40@localhost/adgo-cmde
URL Parse: user 1Cuqb!40 localhost none none adgo-cmde
Net-log: ["Opening" "tcp" "for" "MySQL"]
connecting to: localhost
Net-log: "low level read of 4 bytes"
Net-log: "low level read of 66 bytes"
** Script Error: find expected series argument of type: series object port bitset
** Where: read-packet
** Near: parse/all next pl/buffer case [
    find pl/capabilities 'protocol-41 [
        [
            read-int (pl/error-code: i...
>>
Bo
Hmm, I use mysql-protocol a lot, and I've never seen that type of error before.

DocKimbel
Never seen that error before. Might be caused by a change in the protocol, so that pl/capabilities is not decoded properly anymore.
DideC
Same with a probe of the binary data readed form the mysql server at handshake :
Net-log: ["Opening" "tcp" "for" "MySQL"]
connecting to: localhost
Net-log: "low level read of 4 bytes"
#{42000000}
Net-log: "low level read of 66 bytes"
#{
FF6A04486F737420273132372E302E302E3127206973206E6F7420616C6C6F77
656420746F20636F6E6E65637420746F2074686973204D7953514C2073657276
6572
}
** Script Error: find expected series argument of type: series object port bitset
** Where: read-packet
** Near: parse/all next pl/buffer case [
    find pl/capabilities 'protocol-41 [
        [
            read-int (pl/error-code: i...
(note: first probe is the header, so the length of the packet, second probe is the data).
DocKimbel
>> probe as-string #{
{    FF6A04486F737420273132372E302E302E3127206973206E6F7420616C6C6F77
{    656420746F20636F6E6E65637420746F2074686973204D7953514C2073657276
{    6572
{    }
{ÿj^DHost '127.0.0.1' is not allowed to connect to this MySQL server}
== {ÿj^DHost '127.0.0.1' is not allowed to connect to this MySQL server}
;-)
DideC
Easier when you know you can do that :-)
Thanks, need to investigate that now.
OK, I changed the 'locals-class object! prototype to have an empty block for 'capabilities, and know I get :
Net-log: ["Opening" "tcp" "for" "MySQL"]
connecting to: localhost
Net-log: "low level read of 4 bytes"
Net-log: "low level read of 66 bytes"
#{
FF6A04486F737420273132372E302E302E3127206973206E6F7420616C6C6F77
656420746F20636F6E6E65637420746F2074686973204D7953514C2073657276
6572
}
** User Error: ERROR 1130 : Host '127.0.0.1' is not allowed to connect to this MySQL server
** Near: p: open mysql://user:1Cuqb!40@localhost/adgo-cmde

Last message posted 348 weeks ago.