Commit 22cd31a6 authored by vasil's avatar vasil

branches/zip: Merge 2384:2423 from branches/5.1:

  ------------------------------------------------------------------------
  r2386 | vasil | 2008-03-27 07:45:02 +0200 (Thu, 27 Mar 2008) | 22 lines
  
  branches/5.1:
  
  Merge change from MySQL (this fixes the failing innodb test):
  
  ChangeSet@1.1810.3601.4, 2008-02-07 02:33:21+04:00, gshchepa@host.loc +9 -0
    Fixed bug#30059.
    Server handles truncation for assignment of too-long values
    into CHAR/VARCHAR/TEXT columns in a different ways when the
    truncated characters are spaces:
    1. CHAR(N) columns silently ignore end-space truncation;
    2. TEXT columns post a truncation warning/error in the
       non-strict/strict mode.
    3. VARCHAR columns always post a truncation note in
       any mode.
  
    Space truncation processing has been synchronised over
    CHAR/VARCHAR/TEXT columns: current behavior of VARCHAR
    columns has been propagated as standard.
  
    Binary-encoded string/BLOB columns are not affected.
  
  
  ------------------------------------------------------------------------
  r2387 | vasil | 2008-03-27 08:49:05 +0200 (Thu, 27 Mar 2008) | 8 lines
  
  branches/5.1:
  
  Check whether *trx->mysql_query_str is != NULL in addition to
  trx->mysql_query_str. This adds more safety.
  
  This may or may not fix Bug#35226 RBR event crashes slave.
  
  
  ------------------------------------------------------------------------
  r2388 | vasil | 2008-03-27 14:02:34 +0200 (Thu, 27 Mar 2008) | 7 lines
  
  branches/5.1:
  
  Swap the order in which mysql_thd, mysql_query_str and *mysql_query_str
  are checked for non-NULL.
  
  Suggested by:	Marko
  
  ------------------------------------------------------------------------
  r2419 | vasil | 2008-04-23 19:08:06 +0300 (Wed, 23 Apr 2008) | 9 lines
  
  branches/5.1:
  
  Change the fix for Bug#32440 to show bytes instead of kilobytes in
  INFORMATION_SCHEMA.TABLES.DATA_FREE.
  
  Suggested by:	Domas Mituzas <domas@mysql.com>
  Approved by:	Heikki
  
  
  ------------------------------------------------------------------------
  r2420 | calvin | 2008-04-24 15:25:30 +0300 (Thu, 24 Apr 2008) | 4 lines
  
  branches/5.1: Fix bug#29507 TRUNCATE shows to many rows effected
  
  In InnoDB, the row count is only a rough estimate used by SQL
  optimization. InnoDB is now return row count 0 for TRUNCATE operation.
  ------------------------------------------------------------------------
  r2421 | calvin | 2008-04-24 15:32:30 +0300 (Thu, 24 Apr 2008) | 6 lines
  
  branches/5.1: Fix bug#35537 - Innodb doesn't increment handler_update
  and handler_delete
  
  Add the calls to ha_statistic_increment() in ha_innobase::delete_row()
  and ha_innobase::update_row().
  
  ------------------------------------------------------------------------
  r2422 | vasil | 2008-04-24 16:00:30 +0300 (Thu, 24 Apr 2008) | 11 lines
  
  branches/5.1:
  
  Fix Bug#36169 create innodb compressed table with too large row size crashed
  
  Sometimes it is possible that
  row_drop_table_for_mysql(index->table_name, trx, FALSE); is invoked in
  row_create_index_for_mysql() when the index object is freed so copy the
  table name to a safe place beforehand and use the copy.
  
  Approved by:	Sunny
  
  ------------------------------------------------------------------------
parent c45dedd4
......@@ -4109,6 +4109,8 @@ ha_innobase::update_row(
ut_a(prebuilt->trx == trx);
ha_statistic_increment(&SSV::ha_update_count);
if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_UPDATE)
table->timestamp_field->set_time();
......@@ -4199,6 +4201,8 @@ ha_innobase::delete_row(
ut_a(prebuilt->trx == trx);
ha_statistic_increment(&SSV::ha_delete_count);
/* Only if the table has an AUTOINC column */
if (table->found_next_number_field && record == table->record[0]) {
ulonglong dummy = 0;
......@@ -6526,6 +6530,13 @@ ha_innobase::info(
n_rows++;
}
/* Fix bug#29507: TRUNCATE shows too many rows affected.
Do not show the estimates for TRUNCATE command. */
if (thd_sql_command(user_thd) == SQLCOM_TRUNCATE) {
n_rows = 0;
}
stats.records = (ha_rows)n_rows;
stats.deleted = 0;
stats.data_file_length = ((ulonglong)
......@@ -6536,7 +6547,7 @@ ha_innobase::info(
* UNIV_PAGE_SIZE;
stats.delete_length =
fsp_get_available_space_in_free_extents(
ib_table->space);
ib_table->space) * 1024;
stats.check_time = 0;
if (stats.records == 0) {
......
......@@ -3266,3 +3266,22 @@ AUTO_INCREMENT
200
DROP TABLE t2;
DROP TABLE t1;
CREATE TABLE t1 (c1 int default NULL,
c2 int default NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
TRUNCATE TABLE t1;
affected rows: 0
INSERT INTO t1 VALUES (1, 1), (2, 2), (3, 3), (4, 4), (5, 5);
affected rows: 5
info: Records: 5 Duplicates: 0 Warnings: 0
TRUNCATE TABLE t1;
affected rows: 0
DROP TABLE t1;
Variable_name Value
Handler_update 0
Variable_name Value
Handler_delete 0
Variable_name Value
Handler_update 1
Variable_name Value
Handler_delete 1
......@@ -2459,6 +2459,52 @@ SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE table_name = 't2';
DROP TABLE t2;
DROP TABLE t1;
# End 34920 test
#
# Bug #29507 TRUNCATE shows to many rows effected
#
CONNECTION default;
CREATE TABLE t1 (c1 int default NULL,
c2 int default NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--enable_info
TRUNCATE TABLE t1;
INSERT INTO t1 VALUES (1, 1), (2, 2), (3, 3), (4, 4), (5, 5);
TRUNCATE TABLE t1;
--disable_info
DROP TABLE t1;
#
# Bug#35537 Innodb doesn't increment handler_update and handler_delete.
#
-- disable_query_log
-- disable_result_log
CONNECT (c1,localhost,root,,);
DROP TABLE IF EXISTS bug35537;
CREATE TABLE bug35537 (
c1 int
) ENGINE=InnoDB;
INSERT INTO bug35537 VALUES (1);
-- enable_result_log
SHOW SESSION STATUS LIKE 'Handler_update%';
SHOW SESSION STATUS LIKE 'Handler_delete%';
UPDATE bug35537 SET c1 = 2 WHERE c1 = 1;
DELETE FROM bug35537 WHERE c1 = 2;
SHOW SESSION STATUS LIKE 'Handler_update%';
SHOW SESSION STATUS LIKE 'Handler_delete%';
DROP TABLE bug35537;
DISCONNECT c1;
CONNECTION default;
#######################################################################
# #
......
......@@ -3699,7 +3699,9 @@ shortcut_fails_too_big_rec:
if (trx->isolation_level <= TRX_ISO_READ_COMMITTED
&& prebuilt->select_lock_type != LOCK_NONE
&& trx->mysql_query_str && trx->mysql_thd) {
&& trx->mysql_thd != NULL
&& trx->mysql_query_str != NULL
&& *trx->mysql_query_str != NULL) {
/* Scan the MySQL query string; check if SELECT is the first
word there */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment