create_main_connection use detected_server before setting it

Bug #1265155 reported by CHANIAL David
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MySQL Data Dumper
Fix Released
Low
Max Bubenick

Bug Description

Hi,

It's my first usage of launchpad, and i hope to not make a mistake by using bug instead blueprint or anything else. Let me now if needed and please excuse my bad english.

In 0.5.2 and 0.6.0 we can see in mydumper.c (MYSQL *create_main_connection()) that :

----------------
        if ((detected_server == SERVER_TYPE_MYSQL) && mysql_query(conn, "SET SESSION wait_timeout = 2147483")){
                g_warning("Failed to increase wait_timeout: %s", mysql_error(conn));
        }
        if ((detected_server == SERVER_TYPE_MYSQL) && mysql_query(conn, "SET SESSION net_write_timeout = 2147483")){
                g_warning("Failed to increase net_write_timeout: %s", mysql_error(conn));
        }

        detected_server= detect_server(conn);
----------------

As SERVER_TYPE_MYSQL is declared as 1 :
 enum server_type { SERVER_TYPE_UNKNOWN, SERVER_TYPE_MYSQL, SERVER_TYPE_DRIZZLE };

the two first conditions should never match, and may the " detected_server= detect_server(conn);" should be put first.

Thanks for your attention.

Related branches

Revision history for this message
CHANIAL David (david-chanial) wrote :
Changed in mydumper:
status: New → In Progress
importance: Undecided → Low
assignee: nobody → Max Bubenick (max-bubenick)
Changed in mydumper:
status: In Progress → Fix Committed
Changed in mydumper:
milestone: none → 0.6.1
Changed in mydumper:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.