mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Bug#16095 (INSERT DELAYED crashes mysqld server):
Checking that binlog is open before calling binlog_query(). mysql-test/r/rpl_row_basic_11bugs.result: Result change caused by test change. mysql-test/t/rpl_row_basic_11bugs.test: Ignoring format event since it contain the version number. sql/sql_insert.cc: Debriding code. Checking that binlog is open before calling binlog_query().
This commit is contained in:
@ -24,9 +24,8 @@ SHOW TABLES;
|
|||||||
Tables_in_test_ignore
|
Tables_in_test_ignore
|
||||||
t2
|
t2
|
||||||
INSERT INTO t2 VALUES (3,3), (4,4);
|
INSERT INTO t2 VALUES (3,3), (4,4);
|
||||||
SHOW BINLOG EVENTS;
|
SHOW BINLOG EVENTS FROM 102;
|
||||||
Log_name Pos Event_type Server_id End_log_pos Info
|
Log_name Pos Event_type Server_id End_log_pos Info
|
||||||
master-bin.000001 4 Format_desc 1 102 Server ver: 5.1.5-alpha-debug-log, Binlog ver: 4
|
|
||||||
master-bin.000001 102 Query 1 195 use `test`; CREATE TABLE t1 (a INT, b INT)
|
master-bin.000001 102 Query 1 195 use `test`; CREATE TABLE t1 (a INT, b INT)
|
||||||
master-bin.000001 195 Table_map 1 235 test.t1
|
master-bin.000001 195 Table_map 1 235 test.t1
|
||||||
master-bin.000001 235 Write_rows 1 282
|
master-bin.000001 235 Write_rows 1 282
|
||||||
|
@ -17,7 +17,7 @@ USE test_ignore;
|
|||||||
CREATE TABLE t2 (a INT, b INT);
|
CREATE TABLE t2 (a INT, b INT);
|
||||||
SHOW TABLES;
|
SHOW TABLES;
|
||||||
INSERT INTO t2 VALUES (3,3), (4,4);
|
INSERT INTO t2 VALUES (3,3), (4,4);
|
||||||
SHOW BINLOG EVENTS;
|
SHOW BINLOG EVENTS FROM 102;
|
||||||
sync_slave_with_master;
|
sync_slave_with_master;
|
||||||
--echo **** On Slave ****
|
--echo **** On Slave ****
|
||||||
SHOW DATABASES;
|
SHOW DATABASES;
|
||||||
|
@ -1589,22 +1589,10 @@ static int write_delayed(THD *thd,TABLE *table,enum_duplicates duplic,
|
|||||||
if (thd->killed || !(row= new delayed_row(duplic, ignore, log_on)))
|
if (thd->killed || !(row= new delayed_row(duplic, ignore, log_on)))
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
#if 0
|
|
||||||
if (!query)
|
|
||||||
query_length=0;
|
|
||||||
#endif
|
|
||||||
if (!(row->record= (char*) my_malloc(table->s->reclength, MYF(MY_WME))))
|
if (!(row->record= (char*) my_malloc(table->s->reclength, MYF(MY_WME))))
|
||||||
goto err;
|
goto err;
|
||||||
memcpy(row->record, table->record[0], table->s->reclength);
|
memcpy(row->record, table->record[0], table->s->reclength);
|
||||||
di->set_query(query, query_length);
|
di->set_query(query, query_length);
|
||||||
#if 0
|
|
||||||
if (query_length)
|
|
||||||
{
|
|
||||||
row->query= row->record+table->s->reclength;
|
|
||||||
memcpy(row->query,query,query_length+1);
|
|
||||||
}
|
|
||||||
row->query_length= query_length;
|
|
||||||
#endif
|
|
||||||
row->start_time= thd->start_time;
|
row->start_time= thd->start_time;
|
||||||
row->query_start_used= thd->query_start_used;
|
row->query_start_used= thd->query_start_used;
|
||||||
row->last_insert_id_used= thd->last_insert_id_used;
|
row->last_insert_id_used= thd->last_insert_id_used;
|
||||||
@ -1931,18 +1919,6 @@ bool delayed_insert::handle_inserts(void)
|
|||||||
bool using_ignore=0,
|
bool using_ignore=0,
|
||||||
using_bin_log= mysql_bin_log.is_open();
|
using_bin_log= mysql_bin_log.is_open();
|
||||||
|
|
||||||
#if 0
|
|
||||||
/*
|
|
||||||
The actual text for the query is added to the first row in the
|
|
||||||
list. Since the row is destroyed, with all it's memory, we need
|
|
||||||
to take a copy of it to be able to log it after all rows have been
|
|
||||||
applied.
|
|
||||||
*/
|
|
||||||
uint const query_length= rows.head()->query_length;
|
|
||||||
char *const query= static_cast<char*>(my_alloca(query_length+1));
|
|
||||||
memcpy(query, rows.head()->query, query_length);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
delayed_row *row;
|
delayed_row *row;
|
||||||
DBUG_ENTER("handle_inserts");
|
DBUG_ENTER("handle_inserts");
|
||||||
|
|
||||||
@ -2060,6 +2036,7 @@ bool delayed_insert::handle_inserts(void)
|
|||||||
pthread_mutex_unlock(&mutex);
|
pthread_mutex_unlock(&mutex);
|
||||||
|
|
||||||
/* After releasing the mutex, to prevent deadlocks. */
|
/* After releasing the mutex, to prevent deadlocks. */
|
||||||
|
if (mysql_bin_log.is_open())
|
||||||
thd.binlog_query(THD::ROW_QUERY_TYPE, query, query_length, FALSE, FALSE);
|
thd.binlog_query(THD::ROW_QUERY_TYPE, query, query_length, FALSE, FALSE);
|
||||||
|
|
||||||
if ((error=table->file->extra(HA_EXTRA_NO_CACHE)))
|
if ((error=table->file->extra(HA_EXTRA_NO_CACHE)))
|
||||||
|
Reference in New Issue
Block a user