Skip to content

Commit

Permalink
Automatic merge
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Widenius committed Sep 18, 2012
2 parents f303423 + ae5bc05 commit 6f57fc5
Show file tree
Hide file tree
Showing 59 changed files with 1,247 additions and 198 deletions.
6 changes: 6 additions & 0 deletions BUILD/FINISH.sh
Expand Up @@ -21,6 +21,12 @@ extra_configs="$extra_configs $local_infile_configs $EXTRA_CONFIGS"

configure="./configure $base_configs $extra_configs"

if test "$just_print" = "1" -a "$just_configure" = "1"
then
just_print=""
configure="$configure --print"
fi

commands="\
/bin/rm -rf configure;
/bin/rm -rf CMakeCache.txt CMakeFiles/
Expand Down
7 changes: 7 additions & 0 deletions cmake/configure.pl
Expand Up @@ -25,6 +25,7 @@
# Assume this script is in <srcroot>/cmake
my $srcdir = dirname(dirname(abs_path($0)));
my $cmake_install_prefix="";
my $just_print= 0;

# Sets installation directory, bindir, libdir, libexecdir etc
# the equivalent CMake variables are given without prefix
Expand Down Expand Up @@ -113,6 +114,11 @@ sub check_compiler
system("cmake ${srcdir} -LH");
exit(0);
}
if ($option =~ /print/)
{
$just_print=1;
next;
}
if($option =~ /with-plugins=/)
{
my @plugins= split(/,/, substr($option,13));
Expand Down Expand Up @@ -223,6 +229,7 @@ sub check_compiler
}

print("configure.pl : calling cmake $srcdir $cmakeargs\n");
exit(0) if ($just_print);
unlink("CMakeCache.txt");
my $rc = system("cmake $srcdir $cmakeargs");
exit($rc);
1 change: 1 addition & 0 deletions include/CMakeLists.txt
Expand Up @@ -51,6 +51,7 @@ SET(HEADERS
m_ctype.h
my_attribute.h
my_compiler.h
handler_state.h
)

INSTALL(FILES ${HEADERS} DESTINATION ${INSTALL_INCLUDEDIR} COMPONENT Development)
Expand Down
21 changes: 21 additions & 0 deletions include/handler_state.h
@@ -0,0 +1,21 @@
/*
Map handler error message to sql states. Note that this list MUST be in
increasing order!
See sql_state.c for usage
*/

{ HA_ERR_KEY_NOT_FOUND, "02000", "" },
{ HA_ERR_FOUND_DUPP_KEY, "23000", "" },
{ HA_ERR_WRONG_COMMAND, "0A000", "" },
{ HA_ERR_UNSUPPORTED, "0A000", "" },
{ HA_WRONG_CREATE_OPTION, "0A000", "" },
{ HA_ERR_FOUND_DUPP_UNIQUE, "23000", "" },
{ HA_ERR_UNKNOWN_CHARSET, "0A000", "" },
{ HA_ERR_READ_ONLY_TRANSACTION, "25000", "" },
{ HA_ERR_LOCK_DEADLOCK, "40001", "" },
{ HA_ERR_NO_REFERENCED_ROW, "23000", "" },
{ HA_ERR_ROW_IS_REFERENCED, "23000", "" },
{ HA_ERR_TABLE_EXIST, "42S01", "" },
{ HA_ERR_FOREIGN_DUPLICATE_KEY, "23000", "" },
{ HA_ERR_TABLE_READONLY, "25000", "" },
{ HA_ERR_AUTOINC_ERANGE, "22003", "" },
47 changes: 43 additions & 4 deletions mysql-test/extra/binlog_tests/binlog.test
Expand Up @@ -205,16 +205,55 @@ DROP PROCEDURE p4;

--echo End of 5.0 tests

# Test of a too big SET INSERT_ID: see if the truncated value goes
# into binlog (right), or the too big value (wrong); we look at the
# binlog further down with SHOW BINLOG EVENTS.
# Test of a too big SET INSERT_ID.
# This should generate an error and should not be put in binlog
# We look at the binlog further down with SHOW BINLOG EVENTS.

reset master;
create table t1 (id tinyint auto_increment primary key);
insert into t1 values(5);
set insert_id=128;
--error 167
insert into t1 values(null) /* Not binlogged */;

# The followin insert ignore will be put in binlog
set insert_id=128;
insert into t1 values(null);
insert ignore into t1 values(null) /* Insert 128 */;

# Insert with duplicate key error should not go into binglo
set insert_id=5;
--error ER_DUP_ENTRY
insert into t1 values(null) /* Not binlogged */;

# Insert with autogenerated key + duplicate key error should go into binlog
set insert_id=5;
insert ignore into t1 values(null) /* Insert 5 */;
select * from t1;
drop table t1;

# Same tests but with 2 rows inserted at a time

create table t1 (id tinyint auto_increment primary key) engine=myisam;
set insert_id=128;
--error 167
insert into t1 values(5),(null) /* Insert_id 128 */;

# The followin insert ignore will be put in binlog
set insert_id=128;
insert ignore into t1 values (4),(null) /* Insert_id 128 */;

# Insert with duplicate key error should not go into binglo
set insert_id=5;
--error ER_DUP_ENTRY
insert into t1 values(3),(null) /* Insert_id 5 */;

# Insert with autogenerated key + duplicate key error should go into binlog
set insert_id=5;
insert ignore into t1 values(2),(null) /* Insert_id 5 */;
select * from t1 order by id;
drop table t1;


# bug#22027
create table t1 (a int);
create table if not exists t2 select * from t1;
Expand Down
1 change: 1 addition & 0 deletions mysql-test/extra/binlog_tests/binlog_insert_delayed.test
Expand Up @@ -28,6 +28,7 @@
# BUG#20627: INSERT DELAYED does not honour auto_increment_* variables
# Bug in this test: BUG#38068: binlog_stm_binlog fails sporadically in pushbuild

reset master;

create table t1 (a int not null auto_increment, primary key (a)) engine=myisam;

Expand Down
5 changes: 4 additions & 1 deletion mysql-test/extra/rpl_tests/rpl_auto_increment.test
Expand Up @@ -111,7 +111,7 @@ set auto_increment_increment=11;
set auto_increment_offset=4;
insert into t1 values(null);
insert into t1 values(null);
--error ER_DUP_ENTRY
--error 167
insert into t1 values(null);
select a, mod(a-@@auto_increment_offset,@@auto_increment_increment) from t1 order by a;

Expand All @@ -120,13 +120,16 @@ create table t2 (a tinyint unsigned not null auto_increment primary key) engine=
set auto_increment_increment=10;
set auto_increment_offset=1;
set insert_id=1000;
insert into t2 values(10);
--error 167
insert into t2 values(null);
select a, mod(a-@@auto_increment_offset,@@auto_increment_increment) from t2 order by a;

# An offset so big that even first value does not fit
create table t3 like t1;
set auto_increment_increment=1000;
set auto_increment_offset=700;
--error 167
insert into t3 values(null);
select * from t3 order by a;
sync_slave_with_master;
Expand Down
2 changes: 2 additions & 0 deletions mysql-test/extra/rpl_tests/rpl_insert_delayed.test
Expand Up @@ -102,7 +102,9 @@ CREATE TABLE t1(a int, UNIQUE(a));
--let $_start= query_get_value(SHOW MASTER STATUS, Position, 1)

INSERT DELAYED IGNORE INTO t1 VALUES(1);
--disable_warnings
INSERT DELAYED IGNORE INTO t1 VALUES(1);
--enable_warnings
flush table t1; # to wait for INSERT DELAYED to be done
if (`SELECT @@global.binlog_format = 'STATEMENT'`)
{
Expand Down
3 changes: 2 additions & 1 deletion mysql-test/include/strict_autoinc.inc
Expand Up @@ -19,11 +19,12 @@ select count(*) from t1;

set auto_increment_increment=1000;
set auto_increment_offset=700;
--error ER_WARN_DATA_OUT_OF_RANGE
--error 167
insert into t1 values(null);
select count(*) from t1;

set @@sql_mode=@org_mode;
--error 167
insert into t1 values(null);
select * from t1;

Expand Down
7 changes: 3 additions & 4 deletions mysql-test/r/auto_increment.result
Expand Up @@ -150,7 +150,7 @@ select last_insert_id();
last_insert_id()
255
insert into t1 set i = null;
ERROR 23000: Duplicate entry '255' for key 'PRIMARY'
ERROR 22003: Out of range value for column 'i' at row 1
select last_insert_id();
last_insert_id()
255
Expand All @@ -162,8 +162,7 @@ select last_insert_id();
last_insert_id()
255
insert into t1 set i = null;
Warnings:
Warning 1264 Out of range value for column 'i' at row 1
ERROR 22003: Out of range value for column 'i' at row 1
select last_insert_id();
last_insert_id()
255
Expand Down Expand Up @@ -487,7 +486,7 @@ SELECT @@SESSION.AUTO_INCREMENT_OFFSET;
@@SESSION.AUTO_INCREMENT_OFFSET
1
INSERT INTO t1 VALUES (NULL), (NULL), (NULL);
ERROR 22003: Out of range value for column 't1' at row 167
ERROR 22003: Out of range value for column 'c1' at row 2
SELECT * FROM t1;
c1
1
Expand Down

0 comments on commit 6f57fc5

Please sign in to comment.