Bugfix: MySql reconnect (in query_with_reconnect) #569

merged 1 commit into from Dec 19, 2011


None yet
3 participants

fetzerch commented Dec 12, 2011

The MySql reconnect in query_with_reconnect is broken. Thus after a longer suspend/resume or server restart, the MySql connection fails with "ERROR: SQL: The MySQL server has gone away".

Function mysql-real-query does not return the error code itself. Instead it only returns 0 (success) or a non zero value (always 1 in 5.5.19) on failiure. To get the actual error code, we have to call mysql_errno on the connection.

see http://dev.mysql.com/doc/refman/5.5/en/mysql-real-query.html and http://dev.mysql.com/doc/refman/5.5/en/mysql-errno.html

firnsy commented on 280c19a Dec 19, 2011

@fetzerch good pick up, we'll get this merged in shortly

@mkortstiege mkortstiege added a commit that referenced this pull request Dec 19, 2011

@mkortstiege mkortstiege Merge pull request #569 from fetzerch/bugfix-mysql-reconnect
Bugfix: MySql reconnect (in query_with_reconnect)

@mkortstiege mkortstiege merged commit 533d68e into xbmc:master Dec 19, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment