There is no default database of the connection of spider connect to mysql

Bug #908041 reported by liuyanhong
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Spider for MySQL
Fix Released
Low
Kentoku SHIBA

Bug Description

Recently, we plan to use the spider to solve the high load of mysql, but we found some strange phenomenon.
when our configuration file of remote mysql include parameter as binlog-ignore-db=mysql, the insert statement will not be written to binary log, but update will be written to binary log. we use tcpdump to capture the data, this reason is the update statement is changed to update dbname.tablename set ... where ... limit n. Then, we read the source code of spider, found some code like this:
 mysql_real_connect(conn->db_conn,
                              share->tgt_hosts[link_idx],
                              share->tgt_usernames[link_idx],
                              share->tgt_passwords[link_idx],
                              NULL,
                              share->tgt_ports[link_idx],
                              share->tgt_sockets[link_idx],
                              CLIENT_MULTI_STATEMENTS)
there is no default database used to the function of mysql_real_connection, so, I think this root cause, here are the contents of mysql document:
      There are some rules (--binlog-do-db, --binlog-ignore-db, or both). Is there a default database (has any database been selected by USE?)?
      No: Do not write the statement, and exit.
     Yes: Go to the next step.
can you specify the default database when the connection is been established?

Revision history for this message
Kentoku SHIBA (kentokushiba) wrote :

Fixed at 2.28.

Changed in spiderformysql:
status: New → Fix Committed
importance: Undecided → Low
assignee: nobody → Kentoku SHIBA (kentokushiba)
Changed in spiderformysql:
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.