Discussion of article "Applying network functions, or MySQL without DLL: Part II - Program for monitoring changes in signal properties" - page 2

 
SysFX:

I am just trying to use the MySQL part of the system, but I keep getting a "No database selected" error - even if I issue a "use `mytable`" command.

Do you have any thoughts on why that is happening?

In your case, is `mytable` the name of the base, or table? USE must be followed by the database name, but not the table.
 

I'm using the database name in the "USE" query.

I also noticed the following when removing the EA:

2021.08.20 01:20:24.248 Sync (EURUSD,H1) 6 undeleted objects left
2021.08.20 01:20:24.248 Sync (EURUSD,H1) 1 object of type CMySQLTransaction left
2021.08.20 01:20:24.248 Sync (EURUSD,H1) 1 object of type CMySQLPacket left
2021.08.20 01:20:24.248 Sync (EURUSD,H1) 1 object of type CData left
2021.08.20 01:20:24.248 Sync (EURUSD,H1) 1 object of type CMySQLLoginRequest left
2021.08.20 01:20:24.248 Sync (EURUSD,H1) 2 objects of type CMySQLPacketReader left
2021.08.20 01:20:24.248 Sync (EURUSD,H1) 1024 bytes of leaked memory


I would really like to get the library working as I want to avoid the DLLs used by the other MySQL solutions.

 

Not sure what it means:

Transaction Error: MYSQL_ERR_AUTHORIZATION_TIMEOUT

Here

ENUM_TRANSACTION_STATE res = Incoming(buf,rsp_len);

I get IN_PROGRESS and still no authorisation for the timeout. The data is correct exactly.

Here result I get ...IN_PROGRESS all the time. Where to dig?

ENUM_TRANSACTION_STATE CMySQLTransaction::Incoming(uchar &data[], uint len)
{
 ....
 //--- "Data" package
                     m_packet.type = MYSQL_PACKET_DATA;
                     if((result = PacketDataHandler(&m_packet))==MYSQL_TRANSACTION_ERROR)
                        break;
}

 
leonerd #:

I don't know what that means:

Transaction Error: MYSQL_ERR_AUTHORIZATION_TIMEOUT

Here it is

ENUM_TRANSACTION_STATE res = Incoming(buf,rsp_len);

I get IN_PROGRESS and still no authorisation for the timeout. The data is correct exactly.

Here result I get ...IN_PROGRESS all the time. Where to dig?


Something went wrong after sending the server the login and password.

If the data was incorrect, there would be an error, not a timeout. So either the server didn't respond, or it responded with something the library doesn't understand.

Is there any way to see network packet capture? What version of MySQL server?

 
Serhii Shevchuk #:

Something went wrong after sending the server the login and password.

If the data was incorrect, there would have been an error, not a timeout. But either the server didn't respond, or it responded with something the library didn't understand.

Is there any way to see network packet capture? What version of MySQL server?

"Variable_name" "Value"
"admin_tls_version"     "TLSv1,TLSv1.1,TLSv1.2,TLSv1.3"
"immediate_server_version"      "999999"
"innodb_version"        "8.0.26"
"original_server_version"       "999999"
"protocol_version"      "10"
"replica_type_conversions"      ""
"slave_type_conversions"        ""
"tls_version"   "TLSv1.2"
"version"       "8.0.26-0ubuntu0.20.04.2"
"version_comment"       "(Ubuntu)"
"version_compile_machine"       "x86_64"
"version_compile_os"    "Linux"
"version_compile_zlib"  "1.2.11"
 
Есть возможность посмотреть перехват сетевых пакетов?
wireshark or something? Well, that's gonna take a while. Maybe tomorrow.
 
leonerd wireshark or something? Well, that's gonna take a while. Maybe tomorrow.

Unfortunately, without that it will be hard to determine the cause.

 
By the way, everything worked on mysql 5.7. It doesn't work on 8.0.
 
leonerd #:
By the way, everything worked on mysql 5.7. It doesn't work on 8.0.
So that's where you should have started. Thanks for the message, I'll check it out.
 

And on a running instance (old mysql) I get this from time to time:

2021.09.09 16:57:18.818 prices_to_mysql array out of range in 'MySQLTransaction.mqh' (367,37)

Here on data[ptr]:

ENUM_TRANSACTION_STATE CMySQLTransaction::Incoming(uchar &data[], uint len)
  {
   int ptr=0; // index of the current byte in the data buffer
   ENUM_TRANSACTION_STATE result=MYSQL_TRANSACTION_IN_PROGRESS; // result of processing the received data
   while(len>0)
     {
      if(m_packet.total_length==0)
        {
         //--- If the number of data in the packet is unknown
         while(m_rcv_len<4 && len>0)
           {
            m_hdr[m_rcv_len] = data[ptr];
            m_rcv_len++;
            ptr++;
            len--;
           }