Commit 5bdd04bf authored by tsmith@ramayana.hindu.god's avatar tsmith@ramayana.hindu.god
Browse files

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
parent 3b194176
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
@@ -3264,3 +3264,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
+46 −0
Original line number Diff line number Diff line
@@ -2458,6 +2458,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;

#######################################################################
#                                                                     #
+20 −20
Original line number Diff line number Diff line
@@ -159,11 +159,11 @@ libinnobase_a_CXXFLAGS= $(AM_CFLAGS)
libinnobase_a_CFLAGS=	$(AM_CFLAGS)

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_CXXFLAGS=	$(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
ha_innodb_la_CFLAGS  =	$(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
ha_innodb_la_CXXFLAGS=	$(AM_CFLAGS) $(INNODB_DYNAMIC_CFLAGS)
ha_innodb_la_CFLAGS=	$(AM_CFLAGS) $(INNODB_DYNAMIC_CFLAGS)
ha_innodb_la_SOURCES=	$(libinnobase_a_SOURCES)

EXTRA_DIST=		CMakeLists.txt plug.in \
+12 −1
Original line number Diff line number Diff line
@@ -3752,6 +3752,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();

@@ -3841,6 +3843,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;
@@ -5782,6 +5786,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)
@@ -5792,7 +5803,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) {
+24 −19
Original line number Diff line number Diff line
@@ -23,17 +23,22 @@ MYSQL_PLUGIN_ACTIONS(innobase, [
		CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE -DUNIV_HPUX";;
	aix*)
		CFLAGS="$CFLAGS -DUNIV_AIX";;
         irix*)
           CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE";;
         osf*)
	irix*|osf*|sysv5uw7*|openbsd*)
		CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE";;
	*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
  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:
Loading