Commit 7febbe45 authored by unknown's avatar unknown

Apply InnoDB snapshot innodb-5.1-ss2438.

Addresses the following bugs:

  Change the fix for Bug#32440 to show bytes instead of kilobytes in
  INFORMATION_SCHEMA.TABLES.DATA_FREE.

  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.

  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().

  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.

  Fix Bug#36434 ha_innodb.so is installed in the wrong directory
  Change pkglib_LTLIBRARIES with pkgplugin_LTLIBRARIES which has been
  forgotten in this commit: http://lists.mysql.com/commits/40206


mysql-test/r/innodb.result:
  Apply InnoDB snapshot innodb-5.1-ss2438.
  
  Revision r2420:
  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.
  
  Revision r2421:
  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().
mysql-test/t/innodb.test:
  Apply InnoDB snapshot innodb-5.1-ss2438.
  
  Revision r2420:
  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.
  
  Revision r2421:
  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().
storage/innobase/Makefile.am:
  Apply InnoDB snapshot innodb-5.1-ss2438.
  
  Revision r2429:
  branches/5.1:
  
  * Use INNODB_CFLAGS insead of cluttering CFLAGS with InnoDB specific
    flags. CFLAGS are used to compile every file in the MySQL source tree.
  
  * Add INNODB_DYNAMIC_CFLAGS to the flags of the dynamic plugin and use
    -prefer-non-pic to make the dynamic plugin faster on i386.
  
  Approved by:	Sunny
  
  
  Revision r2437:
  branches/5.1:
  
  Fix Bug#36434 ha_innodb.so is installed in the wrong directory
  
  Change pkglib_LTLIBRARIES with pkgplugin_LTLIBRARIES which has been
  forgotten in this commit: http://lists.mysql.com/commits/40206
  
  
  
  Revision r2430:
  branches/5.1:
  
  Use CFLAGS instead of INNODB_CFLAGS to avoid having incompatible flags
  inserted in CFLAGS and INNODB_CFLAGS and to avoid compiling mysql and
  innodb with different flags.
  
  Discussed with:	Sunny
  
  
  Revision r2434:
  branches/5.1:
  
  Merge changes from MySQL:
  
    ChangeSet@1.2645, 2007-12-19 13:24:43+00:00, jperkin@chorlton.adsl.perkin.org.uk +14 -0
      Add new pkgplugindir handling to seperate plugins from libraries,
      and allow override for binary distributions.  Extend mysql_config
      to print compiled-in plugin location for third-party plugins to
      use.  Resolves bug#31736.
  
  and
  
    ChangeSet@1.2646, 2008-01-02 13:00:46+00:00, jperkin@chorlton.adsl.perkin.org.uk +11 -0
      Use pkglibdir to simplify pkgplugindir, and fix the path in a
      couple of Makefiles.  Continuation of the fix for bug#31736.
  
  
  
  Revision r2436:
  branches/5.1:
  
  Non-functional white space change in Makefile.am:
  Use tabs for indentation and be consistent about spaces around the
  equal sign.
storage/innobase/handler/ha_innodb.cc:
  Apply InnoDB snapshot innodb-5.1-ss2438.
  
  Revision r2419:
  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
  
  
  
  Revision r2435:
  branches/5.1:
  
  Merge change from MySQL:
  
    ChangeSet@1.2563, 2008-03-18 19:42:04+04:00, gluh@mysql.com +1 -0
      Bug#35406 5.1-opt crashes on select from I_S.REFERENTIAL_CONSTRAINTS
      added intialization of f_key_info.referenced_key_name for the case when
      referenced table is dropped
  
  
  
  Revision r2420:
  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.
  
  Revision r2421:
  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().
storage/innobase/plug.in:
  Apply InnoDB snapshot innodb-5.1-ss2438.
  
  Revision r2429:
  branches/5.1:
  
  * Use INNODB_CFLAGS insead of cluttering CFLAGS with InnoDB specific
    flags. CFLAGS are used to compile every file in the MySQL source tree.
  
  * Add INNODB_DYNAMIC_CFLAGS to the flags of the dynamic plugin and use
    -prefer-non-pic to make the dynamic plugin faster on i386.
  
  Approved by:	Sunny
  
  
  Revision r2432:
  branches/5.1:
  
  Non-functional change: use tabs for indentation in plug.in.
  
  
  Revision r2431:
  branches/5.1:
  
  Fix r2430, it should be CFLAGS="$CFLAGS ..." not CFLAGS="..."
  
  
  Revision r2430:
  branches/5.1:
  
  Use CFLAGS instead of INNODB_CFLAGS to avoid having incompatible flags
  inserted in CFLAGS and INNODB_CFLAGS and to avoid compiling mysql and
  innodb with different flags.
  
  Discussed with:	Sunny
  
  
  Revision r2433:
  branches/5.1:
  
  Add vim modeline to hint it that plug.in is a config file
  so it can be colorized.
storage/innobase/row/row0mysql.c:
  Apply InnoDB snapshot innodb-5.1-ss2438.
  
  Revision r2422:
  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
storage/innobase/row/row0sel.c:
  Apply InnoDB snapshot innodb-5.1-ss2438.
  
  Revision r2388:
  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
parent 484d8d33
...@@ -3264,3 +3264,22 @@ AUTO_INCREMENT ...@@ -3264,3 +3264,22 @@ AUTO_INCREMENT
200 200
DROP TABLE t2; DROP TABLE t2;
DROP TABLE t1; 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
...@@ -2458,6 +2458,52 @@ SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE table_name = 't2'; ...@@ -2458,6 +2458,52 @@ SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE table_name = 't2';
DROP TABLE t2; DROP TABLE t2;
DROP TABLE t1; DROP TABLE t1;
# End 34920 test # 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;
####################################################################### #######################################################################
# # # #
......
...@@ -15,21 +15,21 @@ ...@@ -15,21 +15,21 @@
# Process this file with automake to create Makefile.in # Process this file with automake to create Makefile.in
MYSQLDATAdir = $(localstatedir) MYSQLDATAdir= $(localstatedir)
MYSQLSHAREdir = $(pkgdatadir) MYSQLSHAREdir= $(pkgdatadir)
MYSQLBASEdir= $(prefix) MYSQLBASEdir= $(prefix)
MYSQLLIBdir= $(pkglibdir) MYSQLLIBdir= $(pkglibdir)
pkgplugindir = $(pkglibdir)/plugin pkgplugindir= $(pkglibdir)/plugin
INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include \ INCLUDES= -I$(top_srcdir)/include -I$(top_builddir)/include \
-I$(top_srcdir)/regex \ -I$(top_srcdir)/regex \
-I$(top_srcdir)/storage/innobase/include \ -I$(top_srcdir)/storage/innobase/include \
-I$(top_srcdir)/sql \ -I$(top_srcdir)/sql \
-I$(srcdir) -I$(srcdir)
DEFS = @DEFS@ DEFS= @DEFS@
noinst_HEADERS = include/btr0btr.h include/btr0btr.ic \ noinst_HEADERS= include/btr0btr.h include/btr0btr.ic \
include/btr0cur.h include/btr0cur.ic \ include/btr0cur.h include/btr0cur.ic \
include/btr0pcur.h include/btr0pcur.ic \ include/btr0pcur.h include/btr0pcur.ic \
include/btr0sea.h include/btr0sea.ic \ include/btr0sea.h include/btr0sea.ic \
...@@ -121,9 +121,9 @@ noinst_HEADERS = include/btr0btr.h include/btr0btr.ic \ ...@@ -121,9 +121,9 @@ noinst_HEADERS = include/btr0btr.h include/btr0btr.ic \
include/ut0list.ic include/ut0wqueue.h \ include/ut0list.ic include/ut0wqueue.h \
include/ha_prototypes.h handler/ha_innodb.h include/ha_prototypes.h handler/ha_innodb.h
EXTRA_LIBRARIES = libinnobase.a EXTRA_LIBRARIES= libinnobase.a
noinst_LIBRARIES = @plugin_innobase_static_target@ noinst_LIBRARIES= @plugin_innobase_static_target@
libinnobase_a_SOURCES = btr/btr0btr.c btr/btr0cur.c btr/btr0pcur.c \ libinnobase_a_SOURCES= btr/btr0btr.c btr/btr0cur.c btr/btr0pcur.c \
btr/btr0sea.c buf/buf0buf.c buf/buf0flu.c \ btr/btr0sea.c buf/buf0buf.c buf/buf0flu.c \
buf/buf0lru.c buf/buf0rea.c data/data0data.c \ buf/buf0lru.c buf/buf0rea.c data/data0data.c \
data/data0type.c dict/dict0boot.c \ data/data0type.c dict/dict0boot.c \
...@@ -156,17 +156,17 @@ libinnobase_a_SOURCES = btr/btr0btr.c btr/btr0cur.c btr/btr0pcur.c \ ...@@ -156,17 +156,17 @@ libinnobase_a_SOURCES = btr/btr0btr.c btr/btr0cur.c btr/btr0pcur.c \
handler/ha_innodb.cc handler/ha_innodb.cc
libinnobase_a_CXXFLAGS= $(AM_CFLAGS) libinnobase_a_CXXFLAGS= $(AM_CFLAGS)
libinnobase_a_CFLAGS = $(AM_CFLAGS) libinnobase_a_CFLAGS= $(AM_CFLAGS)
EXTRA_LTLIBRARIES = ha_innodb.la EXTRA_LTLIBRARIES= ha_innodb.la
pkglib_LTLIBRARIES = @plugin_innobase_shared_target@ pkgplugin_LTLIBRARIES= @plugin_innobase_shared_target@
ha_innodb_la_LDFLAGS = -module -rpath $(pkgplugindir) ha_innodb_la_LDFLAGS= -module -rpath $(pkgplugindir)
ha_innodb_la_CXXFLAGS= $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN ha_innodb_la_CXXFLAGS= $(AM_CFLAGS) $(INNODB_DYNAMIC_CFLAGS)
ha_innodb_la_CFLAGS = $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN ha_innodb_la_CFLAGS= $(AM_CFLAGS) $(INNODB_DYNAMIC_CFLAGS)
ha_innodb_la_SOURCES = $(libinnobase_a_SOURCES) ha_innodb_la_SOURCES= $(libinnobase_a_SOURCES)
EXTRA_DIST = CMakeLists.txt plug.in \ EXTRA_DIST= CMakeLists.txt plug.in \
pars/make_bison.sh pars/make_flex.sh \ pars/make_bison.sh pars/make_flex.sh \
pars/pars0grm.y pars/pars0lex.l pars/pars0grm.y pars/pars0lex.l
......
...@@ -3752,6 +3752,8 @@ ha_innobase::update_row( ...@@ -3752,6 +3752,8 @@ ha_innobase::update_row(
ut_a(prebuilt->trx == trx); ut_a(prebuilt->trx == trx);
ha_statistic_increment(&SSV::ha_update_count);
if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_UPDATE) if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_UPDATE)
table->timestamp_field->set_time(); table->timestamp_field->set_time();
...@@ -3841,6 +3843,8 @@ ha_innobase::delete_row( ...@@ -3841,6 +3843,8 @@ ha_innobase::delete_row(
ut_a(prebuilt->trx == trx); ut_a(prebuilt->trx == trx);
ha_statistic_increment(&SSV::ha_delete_count);
/* Only if the table has an AUTOINC column */ /* Only if the table has an AUTOINC column */
if (table->found_next_number_field && record == table->record[0]) { if (table->found_next_number_field && record == table->record[0]) {
ulonglong dummy = 0; ulonglong dummy = 0;
...@@ -5782,6 +5786,13 @@ ha_innobase::info( ...@@ -5782,6 +5786,13 @@ ha_innobase::info(
n_rows++; 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.records = (ha_rows)n_rows;
stats.deleted = 0; stats.deleted = 0;
stats.data_file_length = ((ulonglong) stats.data_file_length = ((ulonglong)
...@@ -5792,7 +5803,7 @@ ha_innobase::info( ...@@ -5792,7 +5803,7 @@ ha_innobase::info(
* UNIV_PAGE_SIZE; * UNIV_PAGE_SIZE;
stats.delete_length = stats.delete_length =
fsp_get_available_space_in_free_extents( fsp_get_available_space_in_free_extents(
ib_table->space); ib_table->space) * 1024;
stats.check_time = 0; stats.check_time = 0;
if (stats.records == 0) { if (stats.records == 0) {
......
...@@ -15,25 +15,30 @@ MYSQL_PLUGIN_ACTIONS(innobase, [ ...@@ -15,25 +15,30 @@ MYSQL_PLUGIN_ACTIONS(innobase, [
AC_CHECK_FUNCS(localtime_r) AC_CHECK_FUNCS(localtime_r)
AC_C_BIGENDIAN AC_C_BIGENDIAN
case "$target_os" in case "$target_os" in
lin*) lin*)
CFLAGS="$CFLAGS -DUNIV_LINUX";; CFLAGS="$CFLAGS -DUNIV_LINUX";;
hpux10*) hpux10*)
CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE -DUNIV_HPUX -DUNIV_HPUX10";; CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE -DUNIV_HPUX -DUNIV_HPUX10";;
hp*) hp*)
CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE -DUNIV_HPUX";; CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE -DUNIV_HPUX";;
aix*) aix*)
CFLAGS="$CFLAGS -DUNIV_AIX";; CFLAGS="$CFLAGS -DUNIV_AIX";;
irix*) irix*|osf*|sysv5uw7*|openbsd*)
CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE";; CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE";;
osf*) *solaris*|*SunOS*)
CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE";; CFLAGS="$CFLAGS -DUNIV_SOLARIS";;
*solaris*|*SunOS*)
CFLAGS="$CFLAGS -DUNIV_SOLARIS";;
sysv5uw7*)
# Problem when linking on SCO
CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE";;
openbsd*)
CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE";;
esac esac
INNODB_DYNAMIC_CFLAGS="-DMYSQL_DYNAMIC_PLUGIN"
case "$target_cpu" in
x86_64)
# The AMD64 ABI forbids absolute addresses in shared libraries
;;
*86)
# Use absolute addresses on IA-32
INNODB_DYNAMIC_CFLAGS="$INNODB_DYNAMIC_CFLAGS -prefer-non-pic"
;;
esac
AC_SUBST(INNODB_DYNAMIC_CFLAGS)
]) ])
# vim: set ft=config:
...@@ -1963,6 +1963,7 @@ row_create_index_for_mysql( ...@@ -1963,6 +1963,7 @@ row_create_index_for_mysql(
ulint err; ulint err;
ulint i, j; ulint i, j;
ulint len; ulint len;
char* table_name;
#ifdef UNIV_SYNC_DEBUG #ifdef UNIV_SYNC_DEBUG
ut_ad(rw_lock_own(&dict_operation_lock, RW_LOCK_EX)); ut_ad(rw_lock_own(&dict_operation_lock, RW_LOCK_EX));
...@@ -1972,6 +1973,11 @@ row_create_index_for_mysql( ...@@ -1972,6 +1973,11 @@ row_create_index_for_mysql(
trx->op_info = "creating index"; trx->op_info = "creating index";
/* Copy the table name because we may want to drop the
table later, after the index object is freed (inside
que_run_threads()) and thus index->table_name is not available. */
table_name = mem_strdup(index->table_name);
trx_start_if_not_started(trx); trx_start_if_not_started(trx);
/* Check that the same column does not appear twice in the index. /* Check that the same column does not appear twice in the index.
...@@ -2044,13 +2050,15 @@ error_handling: ...@@ -2044,13 +2050,15 @@ error_handling:
trx_general_rollback_for_mysql(trx, FALSE, NULL); trx_general_rollback_for_mysql(trx, FALSE, NULL);
row_drop_table_for_mysql(index->table_name, trx, FALSE); row_drop_table_for_mysql(table_name, trx, FALSE);
trx->error_state = DB_SUCCESS; trx->error_state = DB_SUCCESS;
} }
trx->op_info = ""; trx->op_info = "";
mem_free(table_name);
return((int) err); return((int) err);
} }
......
...@@ -3577,9 +3577,9 @@ shortcut_fails_too_big_rec: ...@@ -3577,9 +3577,9 @@ shortcut_fails_too_big_rec:
if (trx->isolation_level <= TRX_ISO_READ_COMMITTED if (trx->isolation_level <= TRX_ISO_READ_COMMITTED
&& prebuilt->select_lock_type != LOCK_NONE && prebuilt->select_lock_type != LOCK_NONE
&& trx->mysql_thd != NULL
&& trx->mysql_query_str != NULL && trx->mysql_query_str != NULL
&& *trx->mysql_query_str != NULL && *trx->mysql_query_str != NULL) {
&& trx->mysql_thd != NULL) {
/* Scan the MySQL query string; check if SELECT is the first /* Scan the MySQL query string; check if SELECT is the first
word there */ 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