Commit 898f6f48 authored by unknown's avatar unknown

Merge XtraDB 8 into MariaDB.

parents 275c0a7f 2bde0c5e
...@@ -867,3 +867,25 @@ INSERT INTO t2 SELECT NULL FROM t1; ...@@ -867,3 +867,25 @@ INSERT INTO t2 SELECT NULL FROM t1;
Got one of the listed errors Got one of the listed errors
DROP TABLE t1; DROP TABLE t1;
DROP TABLE t2; DROP TABLE t2;
CREATE TABLE t1 (c1 INT PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
INSERT INTO t1 VALUES (null);
INSERT INTO t1 VALUES (null);
ALTER TABLE t1 CHANGE c1 d1 INT NOT NULL AUTO_INCREMENT;
SELECT * FROM t1;
d1
1
3
SELECT * FROM t1;
d1
1
3
INSERT INTO t1 VALUES(null);
Got one of the listed errors
ALTER TABLE t1 AUTO_INCREMENT = 3;
INSERT INTO t1 VALUES(null);
SELECT * FROM t1;
d1
1
3
4
DROP TABLE t1;
...@@ -1134,4 +1134,40 @@ t2 CREATE TABLE `t2` ( ...@@ -1134,4 +1134,40 @@ t2 CREATE TABLE `t2` (
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE t2; DROP TABLE t2;
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1 (a INT, b CHAR(1)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (3,'a'),(3,'b'),(1,'c'),(0,'d'),(1,'e');
BEGIN;
SELECT * FROM t1;
a b
3 a
3 b
1 c
0 d
1 e
CREATE INDEX t1a ON t1(a);
SELECT * FROM t1;
a b
3 a
3 b
1 c
0 d
1 e
SELECT * FROM t1 FORCE INDEX(t1a) ORDER BY a;
ERROR HY000: Table definition has changed, please retry transaction
SELECT * FROM t1;
a b
3 a
3 b
1 c
0 d
1 e
COMMIT;
SELECT * FROM t1 FORCE INDEX(t1a) ORDER BY a;
a b
0 d
1 c
1 e
3 a
3 b
DROP TABLE t1;
SET GLOBAL innodb_file_format_check=@save_innodb_file_format_check; SET GLOBAL innodb_file_format_check=@save_innodb_file_format_check;
...@@ -1738,7 +1738,7 @@ count(*) ...@@ -1738,7 +1738,7 @@ count(*)
drop table t1; drop table t1;
SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_buffer_pool_pages_total'; SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_buffer_pool_pages_total';
variable_value variable_value
511 8191
SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_page_size'; SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_page_size';
variable_value variable_value
16384 16384
...@@ -1766,9 +1766,10 @@ variable_value - @innodb_row_lock_time_max_orig ...@@ -1766,9 +1766,10 @@ variable_value - @innodb_row_lock_time_max_orig
SELECT variable_value - @innodb_row_lock_time_avg_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_time_avg'; SELECT variable_value - @innodb_row_lock_time_avg_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_time_avg';
variable_value - @innodb_row_lock_time_avg_orig variable_value - @innodb_row_lock_time_avg_orig
0 0
SET @innodb_sync_spin_loops_orig = @@innodb_sync_spin_loops;
show variables like "innodb_sync_spin_loops"; show variables like "innodb_sync_spin_loops";
Variable_name Value Variable_name Value
innodb_sync_spin_loops 20 innodb_sync_spin_loops 30
set global innodb_sync_spin_loops=1000; set global innodb_sync_spin_loops=1000;
show variables like "innodb_sync_spin_loops"; show variables like "innodb_sync_spin_loops";
Variable_name Value Variable_name Value
...@@ -1781,6 +1782,7 @@ set global innodb_sync_spin_loops=20; ...@@ -1781,6 +1782,7 @@ set global innodb_sync_spin_loops=20;
show variables like "innodb_sync_spin_loops"; show variables like "innodb_sync_spin_loops";
Variable_name Value Variable_name Value
innodb_sync_spin_loops 20 innodb_sync_spin_loops 20
set global innodb_sync_spin_loops=@innodb_sync_spin_loops_orig;
SET @old_innodb_thread_concurrency= @@global.innodb_thread_concurrency; SET @old_innodb_thread_concurrency= @@global.innodb_thread_concurrency;
show variables like "innodb_thread_concurrency"; show variables like "innodb_thread_concurrency";
Variable_name Value Variable_name Value
......
set @old_innodb_file_per_table=@@innodb_file_per_table;
set @old_innodb_file_format=@@innodb_file_format; set @old_innodb_file_format=@@innodb_file_format;
set @old_innodb_file_format_check=@@innodb_file_format_check; set @old_innodb_file_per_table=@@innodb_file_per_table;
SET GLOBAL innodb_file_format='Barracuda'; SET GLOBAL innodb_file_format='Barracuda';
SET GLOBAL innodb_file_per_table=ON; SET GLOBAL innodb_file_per_table=ON;
set @old_innodb_file_format=@@innodb_file_format;
select @@innodb_file_format; select @@innodb_file_format;
@@innodb_file_format @@innodb_file_format
Antelope Antelope
...@@ -42,3 +43,5 @@ ERROR HY000: Incorrect arguments to SET ...@@ -42,3 +43,5 @@ ERROR HY000: Incorrect arguments to SET
select @@innodb_file_format_check; select @@innodb_file_format_check;
@@innodb_file_format_check @@innodb_file_format_check
Barracuda Barracuda
set global innodb_file_format=@old_innodb_file_format;
set global innodb_file_format_check=Antelope;
...@@ -478,3 +478,23 @@ INSERT INTO t2 SELECT c1 FROM t1; ...@@ -478,3 +478,23 @@ INSERT INTO t2 SELECT c1 FROM t1;
INSERT INTO t2 SELECT NULL FROM t1; INSERT INTO t2 SELECT NULL FROM t1;
DROP TABLE t1; DROP TABLE t1;
DROP TABLE t2; DROP TABLE t2;
#
# 44030: Error: (1500) Couldn't read the MAX(ID) autoinc value from
# the index (PRIMARY)
# This test requires a restart of the server
CREATE TABLE t1 (c1 INT PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
INSERT INTO t1 VALUES (null);
INSERT INTO t1 VALUES (null);
ALTER TABLE t1 CHANGE c1 d1 INT NOT NULL AUTO_INCREMENT;
SELECT * FROM t1;
# Restart the server
-- source include/restart_mysqld.inc
# The MySQL and InnoDB data dictionaries should now be out of sync.
# The select should print message to the error log
SELECT * FROM t1;
-- error ER_AUTOINC_READ_FAILED,1467
INSERT INTO t1 VALUES(null);
ALTER TABLE t1 AUTO_INCREMENT = 3;
INSERT INTO t1 VALUES(null);
SELECT * FROM t1;
DROP TABLE t1;
...@@ -515,4 +515,28 @@ SHOW CREATE TABLE t2; ...@@ -515,4 +515,28 @@ SHOW CREATE TABLE t2;
DROP TABLE t2; DROP TABLE t2;
DROP TABLE t1; DROP TABLE t1;
connect (a,localhost,root,,);
connect (b,localhost,root,,);
connection a;
CREATE TABLE t1 (a INT, b CHAR(1)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (3,'a'),(3,'b'),(1,'c'),(0,'d'),(1,'e');
connection b;
BEGIN;
SELECT * FROM t1;
connection a;
CREATE INDEX t1a ON t1(a);
connection b;
SELECT * FROM t1;
--error ER_TABLE_DEF_CHANGED
SELECT * FROM t1 FORCE INDEX(t1a) ORDER BY a;
SELECT * FROM t1;
COMMIT;
SELECT * FROM t1 FORCE INDEX(t1a) ORDER BY a;
connection default;
disconnect a;
disconnect b;
DROP TABLE t1;
SET GLOBAL innodb_file_format_check=@save_innodb_file_format_check; SET GLOBAL innodb_file_format_check=@save_innodb_file_format_check;
...@@ -1321,7 +1321,7 @@ drop table t1; ...@@ -1321,7 +1321,7 @@ drop table t1;
# InnoDB aligns the memory for the buffer pool to a page boundary. This may # InnoDB aligns the memory for the buffer pool to a page boundary. This may
# cause actual pool size to be one less than requested depending on exact # cause actual pool size to be one less than requested depending on exact
# alignment of obtained memory. # alignment of obtained memory.
--replace_result 512 511 --replace_result 8192 8191
SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_buffer_pool_pages_total'; SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_buffer_pool_pages_total';
SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_page_size'; SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_page_size';
SELECT variable_value - @innodb_rows_deleted_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_deleted'; SELECT variable_value - @innodb_rows_deleted_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_deleted';
...@@ -1336,6 +1336,7 @@ SELECT variable_value - @innodb_row_lock_time_max_orig FROM information_schema.g ...@@ -1336,6 +1336,7 @@ SELECT variable_value - @innodb_row_lock_time_max_orig FROM information_schema.g
SELECT variable_value - @innodb_row_lock_time_avg_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_time_avg'; SELECT variable_value - @innodb_row_lock_time_avg_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_time_avg';
# Test for innodb_sync_spin_loops variable # Test for innodb_sync_spin_loops variable
SET @innodb_sync_spin_loops_orig = @@innodb_sync_spin_loops;
show variables like "innodb_sync_spin_loops"; show variables like "innodb_sync_spin_loops";
set global innodb_sync_spin_loops=1000; set global innodb_sync_spin_loops=1000;
show variables like "innodb_sync_spin_loops"; show variables like "innodb_sync_spin_loops";
...@@ -1343,6 +1344,7 @@ set global innodb_sync_spin_loops=0; ...@@ -1343,6 +1344,7 @@ set global innodb_sync_spin_loops=0;
show variables like "innodb_sync_spin_loops"; show variables like "innodb_sync_spin_loops";
set global innodb_sync_spin_loops=20; set global innodb_sync_spin_loops=20;
show variables like "innodb_sync_spin_loops"; show variables like "innodb_sync_spin_loops";
set global innodb_sync_spin_loops=@innodb_sync_spin_loops_orig;
# Test for innodb_thread_concurrency variable # Test for innodb_thread_concurrency variable
SET @old_innodb_thread_concurrency= @@global.innodb_thread_concurrency; SET @old_innodb_thread_concurrency= @@global.innodb_thread_concurrency;
...@@ -2555,6 +2557,8 @@ CONNECTION default; ...@@ -2555,6 +2557,8 @@ CONNECTION default;
SET GLOBAL innodb_thread_concurrency = @innodb_thread_concurrency_orig; SET GLOBAL innodb_thread_concurrency = @innodb_thread_concurrency_orig;
-- enable_query_log
####################################################################### #######################################################################
# # # #
# Please, DO NOT TOUCH this file as well as the innodb.result file. # # Please, DO NOT TOUCH this file as well as the innodb.result file. #
......
...@@ -4,9 +4,8 @@ ...@@ -4,9 +4,8 @@
# #
-- source include/have_innodb.inc -- source include/have_innodb.inc
set @old_innodb_file_per_table=@@innodb_file_per_table;
set @old_innodb_file_format=@@innodb_file_format; set @old_innodb_file_format=@@innodb_file_format;
set @old_innodb_file_format_check=@@innodb_file_format_check; set @old_innodb_file_per_table=@@innodb_file_per_table;
SET GLOBAL innodb_file_format='Barracuda'; SET GLOBAL innodb_file_format='Barracuda';
SET GLOBAL innodb_file_per_table=ON; SET GLOBAL innodb_file_per_table=ON;
...@@ -1156,7 +1155,5 @@ DROP TABLE IF EXISTS table4; ...@@ -1156,7 +1155,5 @@ DROP TABLE IF EXISTS table4;
DROP TABLE IF EXISTS table5; DROP TABLE IF EXISTS table5;
DROP TABLE IF EXISTS table6; DROP TABLE IF EXISTS table6;
set global innodb_file_per_table=@old_innodb_file_per_table;
set global innodb_file_format=@old_innodb_file_format; set global innodb_file_format=@old_innodb_file_format;
set global innodb_file_format_check=@old_innodb_file_format_check; set global innodb_file_per_table=@old_innodb_file_per_table;
...@@ -15,7 +15,6 @@ SET storage_engine=InnoDB; ...@@ -15,7 +15,6 @@ SET storage_engine=InnoDB;
-- disable_result_log -- disable_result_log
set @old_innodb_file_per_table=@@innodb_file_per_table; set @old_innodb_file_per_table=@@innodb_file_per_table;
set @old_innodb_file_format=@@innodb_file_format; set @old_innodb_file_format=@@innodb_file_format;
set @old_innodb_file_format_check=@@innodb_file_format_check;
SET GLOBAL innodb_file_format='Barracuda'; SET GLOBAL innodb_file_format='Barracuda';
SET GLOBAL innodb_file_per_table=on; SET GLOBAL innodb_file_per_table=on;
...@@ -30,5 +29,4 @@ CHECK TABLE table0 EXTENDED; ...@@ -30,5 +29,4 @@ CHECK TABLE table0 EXTENDED;
DROP TABLE table0; DROP TABLE table0;
set global innodb_file_per_table=@old_innodb_file_per_table; set global innodb_file_per_table=@old_innodb_file_per_table;
set global innodb_file_format=@old_innodb_file_format; set global innodb_file_format=@old_innodb_file_format;
set global innodb_file_format_check=@old_innodb_file_format_check; set global innodb_file_format_check=Antelope;
-- source include/have_innodb.inc -- source include/have_innodb.inc
-- source suite/innodb/include/have_innodb_plugin.inc set @old_innodb_file_format=@@innodb_file_format;
let $format=`select @@innodb_file_format`;
let $innodb_file_format_check_orig=`select @@innodb_file_format_check`;
select @@innodb_file_format; select @@innodb_file_format;
select @@innodb_file_format_check; select @@innodb_file_format_check;
...@@ -31,11 +28,5 @@ set global innodb_file_format=on; ...@@ -31,11 +28,5 @@ set global innodb_file_format=on;
set global innodb_file_format=off; set global innodb_file_format=off;
select @@innodb_file_format_check; select @@innodb_file_format_check;
# set global innodb_file_format=@old_innodb_file_format;
# restore environment to the state it was before this test execution set global innodb_file_format_check=Antelope;
#
-- disable_query_log
eval set global innodb_file_format=$format;
eval set global innodb_file_format_check=$innodb_file_format_check_orig;
-- enable_query_log
# Copyright (C) 2006 MySQL AB # Copyright (C) 2009 Oracle/Innobase Oy
# #
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
...@@ -11,21 +11,25 @@ ...@@ -11,21 +11,25 @@
# #
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
IF (CMAKE_SIZEOF_VOID_P MATCHES 8)
SET(WIN64 TRUE)
ENDIF (CMAKE_SIZEOF_VOID_P MATCHES 8)
# Check type sizes
include(CheckTypeSize)
# Currently, the checked results are not used.
CHECK_TYPE_SIZE(int SIZEOF_INT)
CHECK_TYPE_SIZE(long SIZEOF_LONG)
CHECK_TYPE_SIZE(void* SIZEOF_VOID_P)
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
INCLUDE("${PROJECT_SOURCE_DIR}/storage/mysql_storage_engine.cmake") INCLUDE("${PROJECT_SOURCE_DIR}/storage/mysql_storage_engine.cmake")
ADD_DEFINITIONS(-D_WIN32 -D_LIB -DMYSQL_SERVER) ADD_DEFINITIONS(-D_WIN32 -D_LIB -DMYSQL_SERVER)
# Bug 19424 - InnoDB: Possibly a memory overrun of the buffer being freed (64-bit Visual C)
# Removing Win64 compiler optimizations for all innodb/mem/* files.
IF(CMAKE_GENERATOR MATCHES "Visual Studio" AND CMAKE_SIZEOF_VOID_P MATCHES 8)
SET_SOURCE_FILES_PROPERTIES(${CMAKE_SOURCE_DIR}/storage/xtradb/mem/mem0mem.c
${CMAKE_SOURCE_DIR}/storage/xtradb/mem/mem0pool.c
PROPERTIES COMPILE_FLAGS -Od)
ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio" AND CMAKE_SIZEOF_VOID_P MATCHES 8)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/zlib INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/zlib
${CMAKE_SOURCE_DIR}/storage/xtradb/include ${CMAKE_SOURCE_DIR}/storage/xtradb/include
${CMAKE_SOURCE_DIR}/storage/xtradb/handler ${CMAKE_SOURCE_DIR}/storage/xtradb/handler
...@@ -33,7 +37,14 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/zlib ...@@ -33,7 +37,14 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/zlib
${CMAKE_SOURCE_DIR}/regex ${CMAKE_SOURCE_DIR}/regex
${CMAKE_SOURCE_DIR}/extra/yassl/include) ${CMAKE_SOURCE_DIR}/extra/yassl/include)
SET(INNOBASE_SOURCES btr/btr0btr.c btr/btr0cur.c btr/btr0pcur.c btr/btr0sea.c # Removing compiler optimizations for innodb/mem/* files on 64-bit Windows
# due to 64-bit compiler error, See MySQL Bug #19424, #36366, #34297
IF(MSVC AND $(WIN64))
SET_SOURCE_FILES_PROPERTIES(mem/mem0mem.c mem/mem0pool.c
PROPERTIES COMPILE_FLAGS -Od)
ENDIF(MSVC AND $(WIN64))
SET(INNODB_SOURCES btr/btr0btr.c btr/btr0cur.c btr/btr0pcur.c btr/btr0sea.c
buf/buf0buddy.c buf/buf0buf.c buf/buf0flu.c buf/buf0lru.c buf/buf0rea.c buf/buf0buddy.c buf/buf0buf.c buf/buf0flu.c buf/buf0lru.c buf/buf0rea.c
data/data0data.c data/data0type.c data/data0data.c data/data0type.c
dict/dict0boot.c dict/dict0crea.c dict/dict0dict.c dict/dict0load.c dict/dict0mem.c dict/dict0boot.c dict/dict0crea.c dict/dict0dict.c dict/dict0load.c dict/dict0mem.c
...@@ -56,16 +67,15 @@ SET(INNOBASE_SOURCES btr/btr0btr.c btr/btr0cur.c btr/btr0pcur.c btr/btr0sea.c ...@@ -56,16 +67,15 @@ SET(INNOBASE_SOURCES btr/btr0btr.c btr/btr0cur.c btr/btr0pcur.c btr/btr0sea.c
handler/ha_innodb.cc handler/handler0alter.cc handler/i_s.cc handler/mysql_addons.cc handler/ha_innodb.cc handler/handler0alter.cc handler/i_s.cc handler/mysql_addons.cc
read/read0read.c read/read0read.c
rem/rem0cmp.c rem/rem0rec.c rem/rem0cmp.c rem/rem0rec.c
row/row0ext.c row/row0ins.c row/row0merge.c row/row0mysql.c row/row0ext.c row/row0ins.c row/row0merge.c row/row0mysql.c row/row0purge.c row/row0row.c
row/row0purge.c row/row0row.c row/row0sel.c row/row0uins.c row/row0sel.c row/row0uins.c row/row0umod.c row/row0undo.c row/row0upd.c row/row0vers.c
row/row0umod.c row/row0undo.c row/row0upd.c row/row0vers.c
srv/srv0que.c srv/srv0srv.c srv/srv0start.c srv/srv0que.c srv/srv0srv.c srv/srv0start.c
sync/sync0arr.c sync/sync0rw.c sync/sync0sync.c sync/sync0arr.c sync/sync0rw.c sync/sync0sync.c
thr/thr0loc.c thr/thr0loc.c
trx/trx0i_s.c trx/trx0purge.c trx/trx0rec.c trx/trx0roll.c trx/trx0rseg.c trx/trx0i_s.c trx/trx0purge.c trx/trx0rec.c trx/trx0roll.c trx/trx0rseg.c
trx/trx0sys.c trx/trx0trx.c trx/trx0undo.c trx/trx0sys.c trx/trx0trx.c trx/trx0undo.c
usr/usr0sess.c usr/usr0sess.c
ut/ut0byte.c ut/ut0dbg.c ut/ut0mem.c ut/ut0rnd.c ut/ut0ut.c ut/ut0vec.c ut/ut0list.c ut/ut0wqueue.c) ut/ut0byte.c ut/ut0dbg.c ut/ut0mem.c ut/ut0rnd.c ut/ut0ut.c ut/ut0vec.c
ut/ut0list.c ut/ut0wqueue.c)
MYSQL_STORAGE_ENGINE(INNOBASE) MYSQL_STORAGE_ENGINE(INNOBASE)
Portions of this software contain modifications contributed by Percona, Inc.
These contributions are used with the following license:
Copyright (c) 2008, 2009, Percona Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials
provided with the distribution.
* Neither the name of the Percona Inc. nor the names of its
contributors may be used to endorse or promote products
derived from this software without specific prior written
permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Portions of this software contain modifications contributed by
Sun Microsystems, Inc. These contributions are used with the following
license:
Copyright (c) 2009, Sun Microsystems, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials
provided with the distribution.
* Neither the name of Sun Microsystems, Inc. nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -16,7 +16,8 @@ Place, Suite 330, Boston, MA 02111-1307 USA ...@@ -16,7 +16,8 @@ Place, Suite 330, Boston, MA 02111-1307 USA
*****************************************************************************/ *****************************************************************************/
/****************************************************** /**************************************************//**
@file btr/btr0pcur.c
The index tree persistent cursor The index tree persistent cursor
Created 2/23/1996 Heikki Tuuri Created 2/23/1996 Heikki Tuuri
...@@ -32,13 +33,13 @@ Created 2/23/1996 Heikki Tuuri ...@@ -32,13 +33,13 @@ Created 2/23/1996 Heikki Tuuri
#include "rem0cmp.h" #include "rem0cmp.h"
#include "trx0trx.h" #include "trx0trx.h"
/****************************************************************** /**************************************************************//**
Allocates memory for a persistent cursor object and initializes the cursor. */ Allocates memory for a persistent cursor object and initializes the cursor.
@return own: persistent cursor */
UNIV_INTERN UNIV_INTERN
btr_pcur_t* btr_pcur_t*
btr_pcur_create_for_mysql(void) btr_pcur_create_for_mysql(void)
/*============================*/ /*============================*/
/* out, own: persistent cursor */
{ {
btr_pcur_t* pcur; btr_pcur_t* pcur;
...@@ -50,13 +51,13 @@ btr_pcur_create_for_mysql(void) ...@@ -50,13 +51,13 @@ btr_pcur_create_for_mysql(void)
return(pcur); return(pcur);
} }
/****************************************************************** /**************************************************************//**
Frees the memory for a persistent cursor object. */ Frees the memory for a persistent cursor object. */
UNIV_INTERN UNIV_INTERN
void void
btr_pcur_free_for_mysql( btr_pcur_free_for_mysql(
/*====================*/ /*====================*/
btr_pcur_t* cursor) /* in, own: persistent cursor */ btr_pcur_t* cursor) /*!< in, own: persistent cursor */
{ {
if (cursor->old_rec_buf != NULL) { if (cursor->old_rec_buf != NULL) {
...@@ -76,7 +77,7 @@ btr_pcur_free_for_mysql( ...@@ -76,7 +77,7 @@ btr_pcur_free_for_mysql(
mem_free(cursor); mem_free(cursor);
} }
/****************************************************************** /**************************************************************//**
The position of the cursor is stored by taking an initial segment of the The position of the cursor is stored by taking an initial segment of the
record the cursor is positioned on, before, or after, and copying it to the record the cursor is positioned on, before, or after, and copying it to the
cursor data structure, or just setting a flag if the cursor id before the cursor data structure, or just setting a flag if the cursor id before the
...@@ -87,8 +88,8 @@ UNIV_INTERN ...@@ -87,8 +88,8 @@ UNIV_INTERN
void void
btr_pcur_store_position( btr_pcur_store_position(
/*====================*/ /*====================*/
btr_pcur_t* cursor, /* in: persistent cursor */ btr_pcur_t* cursor, /*!< in: persistent cursor */
mtr_t* mtr) /* in: mtr */ mtr_t* mtr) /*!< in: mtr */
{ {
page_cur_t* page_cursor; page_cur_t* page_cursor;
buf_block_t* block; buf_block_t* block;
...@@ -157,15 +158,15 @@ btr_pcur_store_position( ...@@ -157,15 +158,15 @@ btr_pcur_store_position(
cursor->modify_clock = buf_block_get_modify_clock(block); cursor->modify_clock = buf_block_get_modify_clock(block);
} }
/****************************************************************** /**************************************************************//**
Copies the stored position of a pcur to another pcur. */ Copies the stored position of a pcur to another pcur. */
UNIV_INTERN UNIV_INTERN
void void
btr_pcur_copy_stored_position( btr_pcur_copy_stored_position(
/*==========================*/ /*==========================*/
btr_pcur_t* pcur_receive, /* in: pcur which will receive the btr_pcur_t* pcur_receive, /*!< in: pcur which will receive the
position info */ position info */
btr_pcur_t* pcur_donate) /* in: pcur from which the info is btr_pcur_t* pcur_donate) /*!< in: pcur from which the info is
copied */ copied */
{ {
if (pcur_receive->old_rec_buf) { if (pcur_receive->old_rec_buf) {
...@@ -187,7 +188,7 @@ btr_pcur_copy_stored_position( ...@@ -187,7 +188,7 @@ btr_pcur_copy_stored_position(
pcur_receive->old_n_fields = pcur_donate->old_n_fields; pcur_receive->old_n_fields = pcur_donate->old_n_fields;
} }
/****************************************************************** /**************************************************************//**
Restores the stored position of a persistent cursor bufferfixing the page and Restores the stored position of a persistent cursor bufferfixing the page and
obtaining the specified latches. If the cursor position was saved when the obtaining the specified latches. If the cursor position was saved when the
(1) cursor was positioned on a user record: this function restores the position (1) cursor was positioned on a user record: this function restores the position
...@@ -198,19 +199,17 @@ infimum; ...@@ -198,19 +199,17 @@ infimum;
(3) cursor was positioned on the page supremum: restores to the first record (3) cursor was positioned on the page supremum: restores to the first record
GREATER than the user record which was the predecessor of the supremum. GREATER than the user record which was the predecessor of the supremum.
(4) cursor was positioned before the first or after the last in an empty tree: (4) cursor was positioned before the first or after the last in an empty tree:
restores to before first or after the last in the tree. */ restores to before first or after the last in the tree.
@return TRUE if the cursor position was stored when it was on a user
record and it can be restored on a user record whose ordering fields
are identical to the ones of the original user record */
UNIV_INTERN UNIV_INTERN
ibool ibool
btr_pcur_restore_position( btr_pcur_restore_position(
/*======================*/ /*======================*/
/* out: TRUE if the cursor position ulint latch_mode, /*!< in: BTR_SEARCH_LEAF, ... */
was stored when it was on a user record btr_pcur_t* cursor, /*!< in: detached persistent cursor */
and it can be restored on a user record mtr_t* mtr) /*!< in: mtr */
whose ordering fields are identical to
the ones of the original user record */
ulint latch_mode, /* in: BTR_SEARCH_LEAF, ... */
btr_pcur_t* cursor, /* in: detached persistent cursor */
mtr_t* mtr) /* in: mtr */
{ {
dict_index_t* index; dict_index_t* index;
dtuple_t* tuple; dtuple_t* tuple;
...@@ -351,7 +350,7 @@ btr_pcur_restore_position( ...@@ -351,7 +350,7 @@ btr_pcur_restore_position(
return(FALSE); return(FALSE);
} }
/****************************************************************** /**************************************************************//**
If the latch mode of the cursor is BTR_LEAF_SEARCH or BTR_LEAF_MODIFY, If the latch mode of the cursor is BTR_LEAF_SEARCH or BTR_LEAF_MODIFY,
releases the page latch and bufferfix reserved by the cursor. releases the page latch and bufferfix reserved by the cursor.
NOTE! In the case of BTR_LEAF_MODIFY, there should not exist changes NOTE! In the case of BTR_LEAF_MODIFY, there should not exist changes
...@@ -361,8 +360,8 @@ UNIV_INTERN ...@@ -361,8 +360,8 @@ UNIV_INTERN
void void
btr_pcur_release_leaf( btr_pcur_release_leaf(
/*==================*/ /*==================*/
btr_pcur_t* cursor, /* in: persistent cursor */ btr_pcur_t* cursor, /*!< in: persistent cursor */
mtr_t* mtr) /* in: mtr */ mtr_t* mtr) /*!< in: mtr */
{ {
buf_block_t* block; buf_block_t* block;
...@@ -378,7 +377,7 @@ btr_pcur_release_leaf( ...@@ -378,7 +377,7 @@ btr_pcur_release_leaf(
cursor->pos_state = BTR_PCUR_WAS_POSITIONED; cursor->pos_state = BTR_PCUR_WAS_POSITIONED;
} }
/************************************************************* /*********************************************************//**
Moves the persistent cursor to the first record on the next page. Releases the Moves the persistent cursor to the first record on the next page. Releases the
latch on the current page, and bufferunfixes it. Note that there must not be latch on the current page, and bufferunfixes it. Note that there must not be
modifications on the current page, as then the x-latch can be released only in modifications on the current page, as then the x-latch can be released only in
...@@ -387,9 +386,9 @@ UNIV_INTERN ...@@ -387,9 +386,9 @@ UNIV_INTERN
void void
btr_pcur_move_to_next_page( btr_pcur_move_to_next_page(
/*=======================*/ /*=======================*/
btr_pcur_t* cursor, /* in: persistent cursor; must be on the btr_pcur_t* cursor, /*!< in: persistent cursor; must be on the
last record of the current page */ last record of the current page */
mtr_t* mtr) /* in: mtr */ mtr_t* mtr) /*!< in: mtr */
{ {
ulint next_page_no; ulint next_page_no;
ulint space; ulint space;
...@@ -429,7 +428,7 @@ btr_pcur_move_to_next_page( ...@@ -429,7 +428,7 @@ btr_pcur_move_to_next_page(
page_check_dir(next_page); page_check_dir(next_page);
} }
/************************************************************* /*********************************************************//**
Moves the persistent cursor backward if it is on the first record of the page. Moves the persistent cursor backward if it is on the first record of the page.
Commits mtr. Note that to prevent a possible deadlock, the operation Commits mtr. Note that to prevent a possible deadlock, the operation
first stores the position of the cursor, commits mtr, acquires the necessary first stores the position of the cursor, commits mtr, acquires the necessary
...@@ -442,9 +441,9 @@ UNIV_INTERN ...@@ -442,9 +441,9 @@ UNIV_INTERN
void void
btr_pcur_move_backward_from_page( btr_pcur_move_backward_from_page(
/*=============================*/ /*=============================*/
btr_pcur_t* cursor, /* in: persistent cursor, must be on the first btr_pcur_t* cursor, /*!< in: persistent cursor, must be on the first
record of the current page */ record of the current page */
mtr_t* mtr) /* in: mtr */ mtr_t* mtr) /*!< in: mtr */
{ {
ulint prev_page_no; ulint prev_page_no;
ulint space; ulint space;
...@@ -511,18 +510,17 @@ btr_pcur_move_backward_from_page( ...@@ -511,18 +510,17 @@ btr_pcur_move_backward_from_page(
cursor->old_stored = BTR_PCUR_OLD_NOT_STORED; cursor->old_stored = BTR_PCUR_OLD_NOT_STORED;
} }
/************************************************************* /*********************************************************//**
Moves the persistent cursor to the previous record in the tree. If no records Moves the persistent cursor to the previous record in the tree. If no records
are left, the cursor stays 'before first in tree'. */ are left, the cursor stays 'before first in tree'.
@return TRUE if the cursor was not before first in tree */
UNIV_INTERN UNIV_INTERN
ibool ibool
btr_pcur_move_to_prev( btr_pcur_move_to_prev(
/*==================*/ /*==================*/
/* out: TRUE if the cursor was not before first btr_pcur_t* cursor, /*!< in: persistent cursor; NOTE that the
in tree */
btr_pcur_t* cursor, /* in: persistent cursor; NOTE that the
function may release the page latch */ function may release the page latch */
mtr_t* mtr) /* in: mtr */ mtr_t* mtr) /*!< in: mtr */
{ {
ut_ad(cursor->pos_state == BTR_PCUR_IS_POSITIONED); ut_ad(cursor->pos_state == BTR_PCUR_IS_POSITIONED);
ut_ad(cursor->latch_mode != BTR_NO_LATCHES); ut_ad(cursor->latch_mode != BTR_NO_LATCHES);
...@@ -546,7 +544,7 @@ btr_pcur_move_to_prev( ...@@ -546,7 +544,7 @@ btr_pcur_move_to_prev(
return(TRUE); return(TRUE);
} }
/****************************************************************** /**************************************************************//**
If mode is PAGE_CUR_G or PAGE_CUR_GE, opens a persistent cursor on the first If mode is PAGE_CUR_G or PAGE_CUR_GE, opens a persistent cursor on the first
user record satisfying the search condition, in the case PAGE_CUR_L or user record satisfying the search condition, in the case PAGE_CUR_L or
PAGE_CUR_LE, on the last user record. If no such user record exists, then PAGE_CUR_LE, on the last user record. If no such user record exists, then
...@@ -557,14 +555,14 @@ UNIV_INTERN ...@@ -557,14 +555,14 @@ UNIV_INTERN
void void
btr_pcur_open_on_user_rec( btr_pcur_open_on_user_rec(
/*======================*/ /*======================*/
dict_index_t* index, /* in: index */ dict_index_t* index, /*!< in: index */
const dtuple_t* tuple, /* in: tuple on which search done */ const dtuple_t* tuple, /*!< in: tuple on which search done */
ulint mode, /* in: PAGE_CUR_L, ... */ ulint mode, /*!< in: PAGE_CUR_L, ... */
ulint latch_mode, /* in: BTR_SEARCH_LEAF or ulint latch_mode, /*!< in: BTR_SEARCH_LEAF or
BTR_MODIFY_LEAF */ BTR_MODIFY_LEAF */
btr_pcur_t* cursor, /* in: memory buffer for persistent btr_pcur_t* cursor, /*!< in: memory buffer for persistent
cursor */ cursor */
mtr_t* mtr) /* in: mtr */ mtr_t* mtr) /*!< in: mtr */
{ {
btr_pcur_open(index, tuple, mode, latch_mode, cursor, mtr); btr_pcur_open(index, tuple, mode, latch_mode, cursor, mtr);
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -16,7 +16,8 @@ Place, Suite 330, Boston, MA 02111-1307 USA ...@@ -16,7 +16,8 @@ Place, Suite 330, Boston, MA 02111-1307 USA
*****************************************************************************/ *****************************************************************************/
/****************************************************** /**************************************************//**
@file data/data0type.c
Data types Data types
Created 1/16/1996 Heikki Tuuri Created 1/16/1996 Heikki Tuuri
...@@ -28,26 +29,8 @@ Created 1/16/1996 Heikki Tuuri ...@@ -28,26 +29,8 @@ Created 1/16/1996 Heikki Tuuri
#include "data0type.ic" #include "data0type.ic"
#endif #endif
/********************************************************************** #ifndef UNIV_HOTBACKUP
This function is used to find the storage length in bytes of the first n # include "ha_prototypes.h"
characters for prefix indexes using a multibyte character set. The function
finds charset information and returns length of prefix_len characters in the
index field in bytes.
NOTE: the prototype of this function is copied from ha_innodb.cc! If you change
this function, you MUST change also the prototype here! */
UNIV_INTERN
ulint
innobase_get_at_most_n_mbchars(
/*===========================*/
/* out: number of bytes occupied by the first
n characters */
ulint charset_id, /* in: character set id */
ulint prefix_len, /* in: prefix length in bytes of the index
(this has to be divided by mbmaxlen to get the
number of CHARACTERS n in the prefix) */
ulint data_len, /* in: length of the string in bytes */
const char* str); /* in: character string */
/* At the database startup we store the default-charset collation number of /* At the database startup we store the default-charset collation number of
this MySQL installation to this global variable. If we have < 4.1.2 format this MySQL installation to this global variable. If we have < 4.1.2 format
...@@ -56,29 +39,27 @@ charset-collation code for them. */ ...@@ -56,29 +39,27 @@ charset-collation code for them. */
UNIV_INTERN ulint data_mysql_default_charset_coll; UNIV_INTERN ulint data_mysql_default_charset_coll;
/************************************************************************* /*********************************************************************//**
Determine how many bytes the first n characters of the given string occupy. Determine how many bytes the first n characters of the given string occupy.
If the string is shorter than n characters, returns the number of bytes If the string is shorter than n characters, returns the number of bytes
the characters in the string occupy. */ the characters in the string occupy.
@return length of the prefix, in bytes */
UNIV_INTERN UNIV_INTERN
ulint ulint
dtype_get_at_most_n_mbchars( dtype_get_at_most_n_mbchars(
/*========================*/ /*========================*/
/* out: length of the prefix, ulint prtype, /*!< in: precise type */
in bytes */ ulint mbminlen, /*!< in: minimum length of a
ulint prtype, /* in: precise type */
ulint mbminlen, /* in: minimum length of a
multi-byte character */ multi-byte character */
ulint mbmaxlen, /* in: maximum length of a ulint mbmaxlen, /*!< in: maximum length of a
multi-byte character */ multi-byte character */
ulint prefix_len, /* in: length of the requested ulint prefix_len, /*!< in: length of the requested
prefix, in characters, multiplied by prefix, in characters, multiplied by
dtype_get_mbmaxlen(dtype) */ dtype_get_mbmaxlen(dtype) */
ulint data_len, /* in: length of str (in bytes) */ ulint data_len, /*!< in: length of str (in bytes) */
const char* str) /* in: the string whose prefix const char* str) /*!< in: the string whose prefix
length is being determined */ length is being determined */
{ {
#ifndef UNIV_HOTBACKUP
ut_a(data_len != UNIV_SQL_NULL); ut_a(data_len != UNIV_SQL_NULL);
ut_ad(!mbmaxlen || !(prefix_len % mbmaxlen)); ut_ad(!mbmaxlen || !(prefix_len % mbmaxlen));
...@@ -96,23 +77,18 @@ dtype_get_at_most_n_mbchars( ...@@ -96,23 +77,18 @@ dtype_get_at_most_n_mbchars(
} }
return(data_len); return(data_len);
#else /* UNIV_HOTBACKUP */
/* This function depends on MySQL code that is not included in
InnoDB Hot Backup builds. Besides, this function should never
be called in InnoDB Hot Backup. */
ut_error;
#endif /* UNIV_HOTBACKUP */
} }
#endif /* UNIV_HOTBACKUP */
/************************************************************************* /*********************************************************************//**
Checks if a data main type is a string type. Also a BLOB is considered a Checks if a data main type is a string type. Also a BLOB is considered a
string type. */ string type.
@return TRUE if string type */
UNIV_INTERN UNIV_INTERN
ibool ibool
dtype_is_string_type( dtype_is_string_type(
/*=================*/ /*=================*/
/* out: TRUE if string type */ ulint mtype) /*!< in: InnoDB main data type code: DATA_CHAR, ... */
ulint mtype) /* in: InnoDB main data type code: DATA_CHAR, ... */
{ {
if (mtype <= DATA_BLOB if (mtype <= DATA_BLOB
|| mtype == DATA_MYSQL || mtype == DATA_MYSQL
...@@ -124,17 +100,17 @@ dtype_is_string_type( ...@@ -124,17 +100,17 @@ dtype_is_string_type(
return(FALSE); return(FALSE);
} }
/************************************************************************* /*********************************************************************//**
Checks if a type is a binary string type. Note that for tables created with Checks if a type is a binary string type. Note that for tables created with
< 4.0.14, we do not know if a DATA_BLOB column is a BLOB or a TEXT column. For < 4.0.14, we do not know if a DATA_BLOB column is a BLOB or a TEXT column. For
those DATA_BLOB columns this function currently returns FALSE. */ those DATA_BLOB columns this function currently returns FALSE.
@return TRUE if binary string type */
UNIV_INTERN UNIV_INTERN
ibool ibool
dtype_is_binary_string_type( dtype_is_binary_string_type(
/*========================*/ /*========================*/
/* out: TRUE if binary string type */ ulint mtype, /*!< in: main data type */
ulint mtype, /* in: main data type */ ulint prtype) /*!< in: precise type */
ulint prtype) /* in: precise type */
{ {
if ((mtype == DATA_FIXBINARY) if ((mtype == DATA_FIXBINARY)
|| (mtype == DATA_BINARY) || (mtype == DATA_BINARY)
...@@ -146,18 +122,18 @@ dtype_is_binary_string_type( ...@@ -146,18 +122,18 @@ dtype_is_binary_string_type(
return(FALSE); return(FALSE);
} }
/************************************************************************* /*********************************************************************//**
Checks if a type is a non-binary string type. That is, dtype_is_string_type is Checks if a type is a non-binary string type. That is, dtype_is_string_type is
TRUE and dtype_is_binary_string_type is FALSE. Note that for tables created TRUE and dtype_is_binary_string_type is FALSE. Note that for tables created
with < 4.0.14, we do not know if a DATA_BLOB column is a BLOB or a TEXT column. with < 4.0.14, we do not know if a DATA_BLOB column is a BLOB or a TEXT column.
For those DATA_BLOB columns this function currently returns TRUE. */ For those DATA_BLOB columns this function currently returns TRUE.
@return TRUE if non-binary string type */
UNIV_INTERN UNIV_INTERN
ibool ibool
dtype_is_non_binary_string_type( dtype_is_non_binary_string_type(
/*============================*/ /*============================*/
/* out: TRUE if non-binary string type */ ulint mtype, /*!< in: main data type */
ulint mtype, /* in: main data type */ ulint prtype) /*!< in: precise type */
ulint prtype) /* in: precise type */
{ {
if (dtype_is_string_type(mtype) == TRUE if (dtype_is_string_type(mtype) == TRUE
&& dtype_is_binary_string_type(mtype, prtype) == FALSE) { && dtype_is_binary_string_type(mtype, prtype) == FALSE) {
...@@ -168,16 +144,17 @@ dtype_is_non_binary_string_type( ...@@ -168,16 +144,17 @@ dtype_is_non_binary_string_type(
return(FALSE); return(FALSE);
} }
/************************************************************************* /*********************************************************************//**
Forms a precise type from the < 4.1.2 format precise type plus the Forms a precise type from the < 4.1.2 format precise type plus the
charset-collation code. */ charset-collation code.
@return precise type, including the charset-collation code */
UNIV_INTERN UNIV_INTERN
ulint ulint
dtype_form_prtype( dtype_form_prtype(
/*==============*/ /*==============*/
ulint old_prtype, /* in: the MySQL type code and the flags ulint old_prtype, /*!< in: the MySQL type code and the flags
DATA_BINARY_TYPE etc. */ DATA_BINARY_TYPE etc. */
ulint charset_coll) /* in: MySQL charset-collation code */ ulint charset_coll) /*!< in: MySQL charset-collation code */
{ {
ut_a(old_prtype < 256 * 256); ut_a(old_prtype < 256 * 256);
ut_a(charset_coll < 256); ut_a(charset_coll < 256);
...@@ -185,14 +162,14 @@ dtype_form_prtype( ...@@ -185,14 +162,14 @@ dtype_form_prtype(
return(old_prtype + (charset_coll << 16)); return(old_prtype + (charset_coll << 16));
} }
/************************************************************************* /*********************************************************************//**
Validates a data type structure. */ Validates a data type structure.
@return TRUE if ok */
UNIV_INTERN UNIV_INTERN
ibool ibool
dtype_validate( dtype_validate(
/*===========*/ /*===========*/
/* out: TRUE if ok */ const dtype_t* type) /*!< in: type struct to validate */
const dtype_t* type) /* in: type struct to validate */
{ {
ut_a(type); ut_a(type);
ut_a(type->mtype >= DATA_VARCHAR); ut_a(type->mtype >= DATA_VARCHAR);
...@@ -202,18 +179,21 @@ dtype_validate( ...@@ -202,18 +179,21 @@ dtype_validate(
ut_a((type->prtype & DATA_MYSQL_TYPE_MASK) < DATA_N_SYS_COLS); ut_a((type->prtype & DATA_MYSQL_TYPE_MASK) < DATA_N_SYS_COLS);
} }
#ifndef UNIV_HOTBACKUP
ut_a(type->mbminlen <= type->mbmaxlen); ut_a(type->mbminlen <= type->mbmaxlen);
#endif /* !UNIV_HOTBACKUP */
return(TRUE); return(TRUE);
} }
/************************************************************************* #ifndef UNIV_HOTBACKUP
/*********************************************************************//**
Prints a data type structure. */ Prints a data type structure. */
UNIV_INTERN UNIV_INTERN
void void
dtype_print( dtype_print(
/*========*/ /*========*/
const dtype_t* type) /* in: type */ const dtype_t* type) /*!< in: type */
{ {
ulint mtype; ulint mtype;
ulint prtype; ulint prtype;
...@@ -298,3 +278,4 @@ dtype_print( ...@@ -298,3 +278,4 @@ dtype_print(
fprintf(stderr, " len %lu", (ulong) len); fprintf(stderr, " len %lu", (ulong) len);
} }
#endif /* !UNIV_HOTBACKUP */
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -16,7 +16,8 @@ Place, Suite 330, Boston, MA 02111-1307 USA ...@@ -16,7 +16,8 @@ Place, Suite 330, Boston, MA 02111-1307 USA
*****************************************************************************/ *****************************************************************************/
/********************************************************************** /******************************************************************//**
@file fut/fut0fut.c
File-based utilities File-based utilities
Created 12/13/1995 Heikki Tuuri Created 12/13/1995 Heikki Tuuri
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -16,12 +16,13 @@ Place, Suite 330, Boston, MA 02111-1307 USA ...@@ -16,12 +16,13 @@ Place, Suite 330, Boston, MA 02111-1307 USA
*****************************************************************************/ *****************************************************************************/
/*********************************************************************** /*******************************************************************//**
@file handler/handler0vars.h
This file contains accessor functions for dynamic plugin on Windows. This file contains accessor functions for dynamic plugin on Windows.
***********************************************************************/ ***********************************************************************/
#if defined __WIN__ && defined MYSQL_DYNAMIC_PLUGIN #if defined __WIN__ && defined MYSQL_DYNAMIC_PLUGIN
/*********************************************************************** /*******************************************************************//**
This is a list of externals that can not be resolved by delay loading. This is a list of externals that can not be resolved by delay loading.
They have to be resolved indirectly via their addresses in the .map file. They have to be resolved indirectly via their addresses in the .map file.
All of them are external variables. */ All of them are external variables. */
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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