Page 3 of 3

Re: Lost connection to MySQL server during query

PostPosted: Mon Sep 04, 2023 5:26 pm
by vilian
Here, the majority are happening for "time out". The user just forget a module openned and after some time try to use it, so the message of "Lost Connection" is shown.

If the message hasn't been shown, I could identify the error, repeat the command and the program would stopped.

Re: Lost connection to MySQL server during query

PostPosted: Mon Sep 04, 2023 5:44 pm
by nageswaragunupudi
What is the error number ?

Re: Lost connection to MySQL server during query

PostPosted: Mon Sep 04, 2023 6:32 pm
by vilian
There is no error number. The complete message error is as bellow:

SELECT mps.cequipto,mps.demanda,mps.dedicada,mps.cmat,Count(*) AS qte FROM tmovgpes AS mps WHERE mps.data = '2023-01-11'AND mps.funcao IN('O','F') GROUP BY mps.cequipto;SHOW FULL COLUMNS FROM tmovgpes [ ERROR: Lost connection to MySQL server during query ]

Re: Lost connection to MySQL server during query

PostPosted: Wed Sep 06, 2023 7:52 am
by nageswaragunupudi
1) Normally an error log should look like this
Code: Select all  Expand view
FWLOG TO ::cLogFile cCallStack( "<-", 3 ), cSql, uRet, ::nError, ::cError, ::cSqlInfo

Error number is shown

2) Please check
Code: Select all  Expand view
? oCn:wait_timeout

By default should be 8 hours

Also, please let us know your MySql server version.
Code: Select all  Expand view
? oCn:cServerInfo
? oCn:nVersion
? oCn:OS


Now we are improving the internal reconnection logic and testing.
We will provide DATA bOnLostServer
If assigned with a codeblock, instead of displaying message, the codeblock will be evaluated. If the codeblock returns .T., the operation will be retried.

Will this be ok for you?

Re: Lost connection to MySQL server during query

PostPosted: Wed Sep 06, 2023 11:08 am
by vilian
Good Morning,

? oCn:wait_timeout = 86400
? oCn:cServerInfo = 5.7.27-log
? oCn:nVersion = 5.72700000
? oCn:OS = Win64

Now we are improving the internal reconnection logic and testing.
We will provide DATA bOnLostServer
If assigned with a codeblock, instead of displaying message, the codeblock will be evaluated. If the codeblock returns .T., the operation will be retried.
Will this be ok for you?

It'll be perfect !!!

Re: Lost connection to MySQL server during query

PostPosted: Wed Sep 06, 2023 12:43 pm
by nageswaragunupudi
do any of these statement work for you?
Code: Select all  Expand view
? oCn:max_statement_time
//or
? oCn:max_execution_time

Re: Lost connection to MySQL server during query

PostPosted: Wed Sep 06, 2023 1:10 pm
by vilian
oCn:max_statement_time

Is generating the error bellow:
Called from: FWMARIA.PRG => FWMARIACONNECTION:MAX_STATEMENT_TIME( 10176 )

? oCn:max_execution_time = 0

Re: Lost connection to MySQL server during query

PostPosted: Fri Sep 08, 2023 11:01 am
by vilian
I've got a complete log of the moment when an error happened.

Code: Select all  Expand view
06/09/2023 16:42:08: FWMARIACONNECTION:EXECUTE_SQL( 6665 )  cCallStack( "<-", 3 ) = "FWMARIACONNECTION:QUERY( 7352 )<-TTARTES:EDITTASK( 6404 )<-(b)TTARTES_DEFINEDIALOGS( 433 )<-TBUTTONBMP:CLICK( 179 )<-TBUTTON:HANDLEEVENT( 1781 )<-TBUTTONBMP:HANDLEEVENT( 261 )<-_FWH( 3560 )<-SENDMESSAGE( 0 )<-TPANEL:COMMAND( 1149 )<-TWINDOW:HANDLEEVENT( 0 )<-TPANEL:HANDLEEVENT( 1827 )<-_FWH( 3560 )<-SYSREFRESH( 0 )<-STOPUNTIL( 71 )<-STV226( 54 )<-SYSEXECFUNCAOBIN( 208 )<-CHAMAPRG( 67 )<-(b)FAZMENUMOD( 433 )<-TMENU:ACTIVATE( 1621 )<-TRBTN:LBUTTONUP( 886 )<-TCONTROL:HANDLEEVENT( 1817 )<-TRBTN:HANDLEEVENT( 1578 )<-_FWH( 3560 )<-WINRUN( 0 )<-TMDIFRAME:ACTIVATE( 1097 )<-START( 178 )"  cSql = "SELECT * FROM ttartes LIMIT 1;SHOW FULL COLUMNS FROM ttartes"   uRet =  ::nError = 2013 ::cError = "Lost connection to MySQL server during query"   ::cSqlInfo = ""