Commit c1cdd288 authored by tomas@whalegate.ndb.mysql.com's avatar tomas@whalegate.ndb.mysql.com

Merge whalegate.ndb.mysql.com:/home/tomas/mysql-5.1

into  whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-single-user
parents 2061324e 21087b05
#! /bin/sh #! /bin/sh
path=`dirname $0` path=`dirname $0`
. "$path/SETUP.sh" $@ . "$path/SETUP.sh"
extra_flags="$pentium_cflags $fast_cflags" extra_flags="$pentium_cflags $fast_cflags"
extra_configs="$pentium_configs $static_link" extra_configs="$pentium_configs $static_link"
......
#! /bin/sh #! /bin/sh
path=`dirname $0` path=`dirname $0`
. "$path/SETUP.sh" $@ --with-debug=full set -- "$@" --with-debug=full
. "$path/SETUP.sh"
extra_flags="$pentium_cflags $debug_cflags" extra_flags="$pentium_cflags $debug_cflags"
extra_configs="$pentium_configs $debug_configs" extra_configs="$pentium_configs $debug_configs"
......
#! /bin/sh #! /bin/sh
path=`dirname $0` path=`dirname $0`
. "$path/SETUP.sh" "$@" --with-debug=full set -- "$@" --with-debug=full
. "$path/SETUP.sh"
extra_flags="$pentium_cflags $debug_cflags" extra_flags="$pentium_cflags $debug_cflags"
extra_configs="$pentium_configs $debug_configs $max_configs $error_inject --with-experimental-collations" extra_configs="$pentium_configs $debug_configs $max_configs $error_inject --with-experimental-collations"
......
#! /bin/sh #! /bin/sh
path=`dirname $0` path=`dirname $0`
. "$path/SETUP.sh" $@ --with-debug=full set -- "$@" --with-debug=full
. "$path/SETUP.sh"
extra_flags="$pentium_cflags $debug_cflags" extra_flags="$pentium_cflags $debug_cflags"
extra_configs="$pentium_configs $debug_configs $max_no_ndb_configs" extra_configs="$pentium_configs $debug_configs $max_no_ndb_configs"
......
#! /bin/sh #! /bin/sh
path=`dirname $0` path=`dirname $0`
. "$path/SETUP.sh" "$@" . "$path/SETUP.sh"
extra_flags="$pentium_cflags $debug_cflags $valgrind_flags" extra_flags="$pentium_cflags $debug_cflags $valgrind_flags"
extra_configs="$pentium_configs $debug_configs $max_configs" extra_configs="$pentium_configs $debug_configs $max_configs"
......
#! /bin/sh #! /bin/sh
path=`dirname $0` path=`dirname $0`
. "$path/SETUP.sh" $@ . "$path/SETUP.sh"
extra_flags="$pentium64_cflags $fast_cflags" extra_flags="$pentium64_cflags $fast_cflags"
extra_configs="$pentium_configs $static_link" extra_configs="$pentium_configs $static_link"
......
#! /bin/sh #! /bin/sh
path=`dirname $0` path=`dirname $0`
. "$path/SETUP.sh" $@ --with-debug=full set -- "$@" --with-debug=full
. "$path/SETUP.sh"
extra_flags="$pentium64_cflags $debug_cflags" extra_flags="$pentium64_cflags $debug_cflags"
extra_configs="$pentium_configs $debug_configs $static_link" extra_configs="$pentium_configs $debug_configs $static_link"
......
#! /bin/sh #! /bin/sh
path=`dirname $0` path=`dirname $0`
. "$path/SETUP.sh" $@ --with-debug=full set -- "$@" --with-debug=full
. "$path/SETUP.sh"
extra_flags="$pentium64_cflags $debug_cflags" extra_flags="$pentium64_cflags $debug_cflags"
extra_configs="$pentium_configs $debug_configs $max_configs" extra_configs="$pentium_configs $debug_configs $max_configs"
......
#! /bin/sh #! /bin/sh
path=`dirname $0` path=`dirname $0`
. "$path/SETUP.sh" $@ . "$path/SETUP.sh"
extra_flags="$pentium64_cflags $fast_cflags" extra_flags="$pentium64_cflags $fast_cflags"
extra_configs="$pentium_configs $max_configs $static_link" extra_configs="$pentium_configs $max_configs $static_link"
......
...@@ -123,6 +123,10 @@ test-bt: ...@@ -123,6 +123,10 @@ test-bt:
-cd mysql-test ; MTR_BUILD_THREAD=auto \ -cd mysql-test ; MTR_BUILD_THREAD=auto \
@PERL@ ./mysql-test-run.pl --comment=NDB --force --timer \ @PERL@ ./mysql-test-run.pl --comment=NDB --force --timer \
--with-ndbcluster-only --with-ndbcluster-only
-cd mysql-test ; MTR_BUILD_THREAD=auto \
@PERL@ ./mysql-test-run.pl --force --comment=funcs1_ps --ps-protocol --suite=funcs_1
-cd mysql-test ; MTR_BUILD_THREAD=auto \
@PERL@ ./mysql-test-run.pl --force --comment=funcs2 --suite=funcs_2
test-bt-debug: test-bt-debug:
-cd mysql-test ; MTR_BUILD_THREAD=auto \ -cd mysql-test ; MTR_BUILD_THREAD=auto \
......
...@@ -425,6 +425,22 @@ AC_SUBST(PERL5) ...@@ -425,6 +425,22 @@ AC_SUBST(PERL5)
# icheck, used for ABI check # icheck, used for ABI check
AC_PATH_PROG(ICHECK, icheck, no) AC_PATH_PROG(ICHECK, icheck, no)
# "icheck" is also the name of a file system check program on Tru64.
# Verify the program found is really the interface checker.
if test "x$ICHECK" != "xno"
then
AC_MSG_CHECKING(if $ICHECK works as expected)
echo "int foo;" > conftest.h
$ICHECK --canonify -o conftest.ic conftest.h 2>/dev/null
if test -f "conftest.ic"
then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
ICHECK=no
fi
rm -f conftest.ic conftest.h
fi
AC_SUBST(ICHECK) AC_SUBST(ICHECK)
# Lock for PS # Lock for PS
...@@ -2301,28 +2317,6 @@ AC_ARG_WITH(man, ...@@ -2301,28 +2317,6 @@ AC_ARG_WITH(man,
[with_man=yes] [with_man=yes]
) )
if test X"$with_man" = Xyes
then
man_dirs="man"
if test X"$have_ndbcluster" = Xyes
then
man1_files=`ls $srcdir/man/*.1 | sed -e 's;^.*man/;;'`
man8_files=`ls $srcdir/man/*.8 | sed -e 's;^.*man/;;'`
else
man1_files=`ls $srcdir/man/*.1 | grep -v '/ndb' | sed -e 's;^.*man/;;'`
man8_files=`ls $srcdir/man/*.8 | grep -v '/ndb' | sed -e 's;^.*man/;;'`
fi
man1_files=`echo $man1_files`
man8_files=`echo $man8_files`
else
man_dirs=""
man1_files=""
man8_files=""
fi
AC_SUBST(man_dirs)
AC_SUBST(man1_files)
AC_SUBST(man8_files)
# Don't build readline, i have it already # Don't build readline, i have it already
AC_ARG_WITH(readline, AC_ARG_WITH(readline,
[ --without-readline Use system readline instead of bundled copy.], [ --without-readline Use system readline instead of bundled copy.],
...@@ -2449,6 +2443,61 @@ AC_SUBST(readline_link) ...@@ -2449,6 +2443,61 @@ AC_SUBST(readline_link)
AC_SUBST(readline_h_ln_cmd) AC_SUBST(readline_h_ln_cmd)
# Include man pages, if desired, adapted to the configured parts.
if test X"$with_man" = Xyes
then
# First, create the list of all man pages present.
MANLISTFIL=manlist.$$
TMPLISTFIL=`echo $MANLISTFIL | sed -e 's/manlist/tmplist/'`
if test -f $MANLISTFIL -o -f $TMPLISTFIL
then
echo "Temp file '$MANLISTFIL' or '$TMPLISTFIL' already exists in '`pwd`' - aborting"
exit 1
fi
touch $MANLISTFIL $TMPLISTFIL
ls $srcdir/man/*.[[18]] > $MANLISTFIL
# Then, remove all those pages from the list which are specific to parts
# (table handlers, features, ...) which are not configured in this run.
AC_MSG_CHECKING("for man pages to remove")
MAN_DROP="dropping"
if test X"$with_plugin_ndbcluster" != Xyes
then
MAN_DROP="$MAN_DROP ndbcluster"
grep -v '/ndb' $MANLISTFIL > $TMPLISTFIL ; mv -f $TMPLISTFIL $MANLISTFIL
fi
if test X"$with_embedded_server" != Xyes
then
MAN_DROP="$MAN_DROP embedded"
grep -v 'embedded' $MANLISTFIL > $TMPLISTFIL ; mv -f $TMPLISTFIL $MANLISTFIL
fi
if test X"$with_plugin_innobase" != Xyes
then
MAN_DROP="$MAN_DROP innodb"
grep -v 'inno' $MANLISTFIL > $TMPLISTFIL ; mv -f $TMPLISTFIL $MANLISTFIL
fi
AC_MSG_RESULT([$MAN_DROP])
# Finally, split the man pages into sections 1 and 8.
# Get rid of line breaks.
man1_files=`sed -n -e '/\.1$/s/^.*man\///p' <$MANLISTFIL`
man8_files=`sed -n -e '/\.8$/s/^.*man\///p' <$MANLISTFIL`
man_dirs="man"
man1_files=`echo $man1_files`
man8_files=`echo $man8_files`
rm -f $MANLISTFIL $TMPLISTFIL
else
man_dirs=""
man1_files=""
man8_files=""
fi
AC_SUBST(man_dirs)
AC_SUBST(man1_files)
AC_SUBST(man8_files)
# If we have threads generate some library functions and test programs # If we have threads generate some library functions and test programs
sql_server_dirs= sql_server_dirs=
sql_server= sql_server=
......
...@@ -574,10 +574,12 @@ int main (int argc, char **argv) ...@@ -574,10 +574,12 @@ int main (int argc, char **argv)
FILE *infile; FILE *infile;
FILE *outfile = {stdout}; FILE *outfile = {stdout};
#if defined(HAVE_PTHREAD_INIT) && defined(THREAD) #ifdef THREAD
#if defined(HAVE_PTHREAD_INIT)
pthread_init(); /* Must be called before DBUG_ENTER */ pthread_init(); /* Must be called before DBUG_ENTER */
#endif #endif
my_thread_global_init(); my_thread_global_init();
#endif /* THREAD */
{ {
DBUG_ENTER ("main"); DBUG_ENTER ("main");
DBUG_PROCESS (argv[0]); DBUG_PROCESS (argv[0]);
......
...@@ -23,7 +23,7 @@ HEADERS_ABI = mysql.h mysql_com.h mysql_time.h \ ...@@ -23,7 +23,7 @@ HEADERS_ABI = mysql.h mysql_com.h mysql_time.h \
pkginclude_HEADERS = $(HEADERS_ABI) my_dbug.h m_string.h my_sys.h \ pkginclude_HEADERS = $(HEADERS_ABI) my_dbug.h m_string.h my_sys.h \
my_xml.h mysql_embed.h \ my_xml.h mysql_embed.h \
my_pthread.h my_no_pthread.h \ my_pthread.h my_no_pthread.h \
errmsg.h my_global.h my_net.h \ decimal.h errmsg.h my_global.h my_net.h \
my_getopt.h sslopt-longopts.h my_dir.h \ my_getopt.h sslopt-longopts.h my_dir.h \
sslopt-vars.h sslopt-case.h sql_common.h keycache.h \ sslopt-vars.h sslopt-case.h sql_common.h keycache.h \
m_ctype.h mysql/plugin.h my_attribute.h $(HEADERS_GEN) m_ctype.h mysql/plugin.h my_attribute.h $(HEADERS_GEN)
...@@ -34,7 +34,7 @@ noinst_HEADERS = config-win.h config-netware.h \ ...@@ -34,7 +34,7 @@ noinst_HEADERS = config-win.h config-netware.h \
my_nosys.h my_alarm.h queues.h rijndael.h sha1.h \ my_nosys.h my_alarm.h queues.h rijndael.h sha1.h \
my_aes.h my_tree.h my_trie.h hash.h thr_alarm.h \ my_aes.h my_tree.h my_trie.h hash.h thr_alarm.h \
thr_lock.h t_ctype.h violite.h md5.h base64.h \ thr_lock.h t_ctype.h violite.h md5.h base64.h \
mysql_version.h.in my_handler.h my_time.h decimal.h \ mysql_version.h.in my_handler.h my_time.h \
my_vle.h my_user.h my_atomic.h atomic/nolock.h \ my_vle.h my_user.h my_atomic.h atomic/nolock.h \
atomic/rwlock.h atomic/x86-gcc.h atomic/x86-msvc.h \ atomic/rwlock.h atomic/x86-gcc.h atomic/x86-msvc.h \
my_libwrap.h my_libwrap.h
......
...@@ -24,7 +24,7 @@ benchdir_root= $(prefix) ...@@ -24,7 +24,7 @@ benchdir_root= $(prefix)
testdir = $(benchdir_root)/mysql-test testdir = $(benchdir_root)/mysql-test
EXTRA_SCRIPTS = mysql-test-run-shell.sh install_test_db.sh \ EXTRA_SCRIPTS = mysql-test-run-shell.sh install_test_db.sh \
valgrind.supp $(PRESCRIPTS) valgrind.supp $(PRESCRIPTS)
EXTRA_DIST = $(EXTRA_SCRIPTS) EXTRA_DIST = $(EXTRA_SCRIPTS) suite
GENSCRIPTS = mysql-test-run-shell install_test_db mtr mysql-test-run GENSCRIPTS = mysql-test-run-shell install_test_db mtr mysql-test-run
PRESCRIPTS = mysql-test-run.pl PRESCRIPTS = mysql-test-run.pl
test_SCRIPTS = $(GENSCRIPTS) $(PRESCRIPTS) test_SCRIPTS = $(GENSCRIPTS) $(PRESCRIPTS)
...@@ -71,6 +71,7 @@ dist-hook: ...@@ -71,6 +71,7 @@ dist-hook:
$(INSTALL_DATA) $(srcdir)/std_data/ndb_backup50/BACKUP* $(distdir)/std_data/ndb_backup50 $(INSTALL_DATA) $(srcdir)/std_data/ndb_backup50/BACKUP* $(distdir)/std_data/ndb_backup50
$(INSTALL_DATA) $(srcdir)/std_data/ndb_backup51/BACKUP* $(distdir)/std_data/ndb_backup51 $(INSTALL_DATA) $(srcdir)/std_data/ndb_backup51/BACKUP* $(distdir)/std_data/ndb_backup51
$(INSTALL_DATA) $(srcdir)/lib/*.pl $(distdir)/lib $(INSTALL_DATA) $(srcdir)/lib/*.pl $(distdir)/lib
-rm -rf `find $(distdir)/suite -type d -name SCCS`
install-data-local: install-data-local:
$(mkinstalldirs) \ $(mkinstalldirs) \
...@@ -112,6 +113,12 @@ install-data-local: ...@@ -112,6 +113,12 @@ install-data-local:
$(INSTALL_DATA) $(srcdir)/std_data/ndb_backup50/BACKUP* $(DESTDIR)$(testdir)/std_data/ndb_backup50 $(INSTALL_DATA) $(srcdir)/std_data/ndb_backup50/BACKUP* $(DESTDIR)$(testdir)/std_data/ndb_backup50
$(INSTALL_DATA) $(srcdir)/std_data/ndb_backup51/BACKUP* $(DESTDIR)$(testdir)/std_data/ndb_backup51 $(INSTALL_DATA) $(srcdir)/std_data/ndb_backup51/BACKUP* $(DESTDIR)$(testdir)/std_data/ndb_backup51
$(INSTALL_DATA) $(srcdir)/lib/*.pl $(DESTDIR)$(testdir)/lib $(INSTALL_DATA) $(srcdir)/lib/*.pl $(DESTDIR)$(testdir)/lib
for f in `(cd $(srcdir); find suite -type f | grep -v SCCS)`; \
do \
d=$(DESTDIR)$(testdir)/`dirname $$f`; \
mkdir -p $$d ; \
$(INSTALL_DATA) $(srcdir)/$$f $$d ; \
done
uninstall-local: uninstall-local:
@RM@ -f -r $(DESTDIR)$(testdir) @RM@ -f -r $(DESTDIR)$(testdir)
......
...@@ -4,6 +4,9 @@ ...@@ -4,6 +4,9 @@
# Purpose: To test having extra columns on the slave. # Purpose: To test having extra columns on the slave.
################################################## ##################################################
# Some tests in here requre partitioning
-- source include/have_partition.inc
########### Clean up ################ ########### Clean up ################
--disable_warnings --disable_warnings
--disable_query_log --disable_query_log
......
...@@ -469,3 +469,10 @@ a FORMAT(MATCH(a) AGAINST('test1 test'),6) ...@@ -469,3 +469,10 @@ a FORMAT(MATCH(a) AGAINST('test1 test'),6)
test1 0.685267 test1 0.685267
DEALLOCATE PREPARE stmt; DEALLOCATE PREPARE stmt;
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(255), FULLTEXT(a));
SELECT * FROM t1 IGNORE INDEX(a) WHERE MATCH(a) AGAINST('test');
a
ALTER TABLE t1 DISABLE KEYS;
SELECT * FROM t1 WHERE MATCH(a) AGAINST('test');
ERROR HY000: Can't find FULLTEXT index matching the column list
DROP TABLE t1;
...@@ -819,6 +819,17 @@ ALTER TABLE m1 ENGINE=MERGE UNION=(t1); ...@@ -819,6 +819,17 @@ ALTER TABLE m1 ENGINE=MERGE UNION=(t1);
SELECT * FROM m1; SELECT * FROM m1;
c1 c2 c3 c4 c5 c6 c7 c8 c9 c1 c2 c3 c4 c5 c6 c7 c8 c9
DROP TABLE t1, m1; DROP TABLE t1, m1;
CREATE TABLE t1 (a VARCHAR(255) CHARACTER SET latin1 COLLATE latin1_german2_ci,
b INT, INDEX(a,b));
CREATE TABLE t2 LIKE t1;
CREATE TABLE t3 LIKE t1;
ALTER TABLE t3 ENGINE=MERGE UNION=(t1,t2);
INSERT INTO t1 VALUES ('ss',1);
INSERT INTO t2 VALUES ('ss',2),(0xDF,2);
SELECT COUNT(*) FROM t3 WHERE a=0xDF AND b=2;
COUNT(*)
2
DROP TABLE t1,t2,t3;
create table t1 (b bit(1)); create table t1 (b bit(1));
create table t2 (b bit(1)); create table t2 (b bit(1));
create table tm (b bit(1)) engine = merge union = (t1,t2); create table tm (b bit(1)) engine = merge union = (t1,t2);
......
...@@ -57,26 +57,6 @@ create table t1 (s1 int); ...@@ -57,26 +57,6 @@ create table t1 (s1 int);
insert into t1 (s1) values (1), (2), (3), (4), (5); insert into t1 (s1) values (1), (2), (3), (4), (5);
create view v1 as select * from t1; create view v1 as select * from t1;
truncate table v1; truncate table v1;
select count(*) from t1; ERROR 42S02: Table 'test.v1' doesn't exist
count(*) drop view v1;
0 drop table t1;
insert into t1 (s1) values (1), (2), (3), (4), (5);
create view v2 as select * from t1 where s1 > 3;
truncate table v2;
select * from t1;
s1
1
2
3
select * from v2;
s1
delete from t1;
create table t2 (s1 int, s2 int);
create view v3 as select a.s1, b.s2 from t1 a join t2 b on a.s1 = b.s1 where a.s1 > 3;
truncate table v3;
ERROR HY000: Can not delete from join view 'test.v3'
create view v4 as select * from t1 limit 1,1;
truncate table v4;
ERROR HY000: The target table v4 of the TRUNCATE is not updatable
drop view v1, v2, v3, v4;
drop table t1, t2;
...@@ -389,4 +389,14 @@ EXECUTE stmt; ...@@ -389,4 +389,14 @@ EXECUTE stmt;
DEALLOCATE PREPARE stmt; DEALLOCATE PREPARE stmt;
DROP TABLE t1; DROP TABLE t1;
#
# BUG#25951 - ignore/use index does not work with fulltext
#
CREATE TABLE t1 (a VARCHAR(255), FULLTEXT(a));
SELECT * FROM t1 IGNORE INDEX(a) WHERE MATCH(a) AGAINST('test');
ALTER TABLE t1 DISABLE KEYS;
--error 1191
SELECT * FROM t1 WHERE MATCH(a) AGAINST('test');
DROP TABLE t1;
# End of 4.1 tests # End of 4.1 tests
...@@ -451,6 +451,19 @@ ALTER TABLE m1 ENGINE=MERGE UNION=(t1); ...@@ -451,6 +451,19 @@ ALTER TABLE m1 ENGINE=MERGE UNION=(t1);
SELECT * FROM m1; SELECT * FROM m1;
DROP TABLE t1, m1; DROP TABLE t1, m1;
#
# BUG#24342 - Incorrect results with query over MERGE table
#
CREATE TABLE t1 (a VARCHAR(255) CHARACTER SET latin1 COLLATE latin1_german2_ci,
b INT, INDEX(a,b));
CREATE TABLE t2 LIKE t1;
CREATE TABLE t3 LIKE t1;
ALTER TABLE t3 ENGINE=MERGE UNION=(t1,t2);
INSERT INTO t1 VALUES ('ss',1);
INSERT INTO t2 VALUES ('ss',2),(0xDF,2);
SELECT COUNT(*) FROM t3 WHERE a=0xDF AND b=2;
DROP TABLE t1,t2,t3;
# End of 4.1 tests # End of 4.1 tests
# #
......
...@@ -415,9 +415,13 @@ drop table t1; ...@@ -415,9 +415,13 @@ drop table t1;
# #
# BUG 14524 # BUG 14524
# #
# Disable warnings to allow this test case to work without
# the Blackhole engine.
--disable_warnings
CREATE TABLE `t1` ( CREATE TABLE `t1` (
`id` int(11) default NULL `id` int(11) default NULL
) ENGINE=BLACKHOLE DEFAULT CHARSET=latin1 PARTITION BY HASH (id) ; ) ENGINE=BLACKHOLE DEFAULT CHARSET=latin1 PARTITION BY HASH (id) ;
--enable_warnings
SELECT * FROM t1; SELECT * FROM t1;
drop table t1; drop table t1;
...@@ -425,9 +429,13 @@ drop table t1; ...@@ -425,9 +429,13 @@ drop table t1;
# #
# BUG 14524 # BUG 14524
# #
# Disable warnings to allow this test case to work without
# the Blackhole engine.
--disable_warnings
CREATE TABLE `t1` ( CREATE TABLE `t1` (
`id` int(11) default NULL `id` int(11) default NULL
) ENGINE=BLACKHOLE DEFAULT CHARSET=latin1 PARTITION BY HASH (id) ; ) ENGINE=BLACKHOLE DEFAULT CHARSET=latin1 PARTITION BY HASH (id) ;
--enable_warnings
SELECT * FROM t1; SELECT * FROM t1;
drop table t1; drop table t1;
......
...@@ -129,7 +129,11 @@ drop table t1; ...@@ -129,7 +129,11 @@ drop table t1;
# #
# BUG# 14524 Partitions: crash if blackhole # BUG# 14524 Partitions: crash if blackhole
# #
# Disable warnings to allow this test case to run without
# the Blackhole storage engine.
--disable_warnings
CREATE TABLE t1 (s1 int) ENGINE=BLACKHOLE PARTITION BY HASH (s1); CREATE TABLE t1 (s1 int) ENGINE=BLACKHOLE PARTITION BY HASH (s1);
--enable_warnings
INSERT INTO t1 VALUES (0); INSERT INTO t1 VALUES (0);
DROP TABLE t1; DROP TABLE t1;
......
--source include/have_binlog_format_row.inc --source include/have_binlog_format_row.inc
let $SERVER_VERSION=`select version()`; let $SERVER_VERSION=`select version()`;
#This test case is not written for NDB, the result files #This test case is not written for NDB, the result files
...@@ -127,6 +126,8 @@ sync_slave_with_master; ...@@ -127,6 +126,8 @@ sync_slave_with_master;
--source include/master-slave-reset.inc --source include/master-slave-reset.inc
--enable_query_log --enable_query_log
# disabling warnings temporarily for ENGINE=INNODB to work without InnoDB
--disable_warnings
--echo **** On Master **** --echo **** On Master ****
connection master; connection master;
CREATE TABLE t1_myisam (k INT, a BIT(1), b BIT(9)) ENGINE=MYISAM; CREATE TABLE t1_myisam (k INT, a BIT(1), b BIT(9)) ENGINE=MYISAM;
...@@ -139,6 +140,7 @@ ALTER TABLE t1_myisam ENGINE=INNODB; ...@@ -139,6 +140,7 @@ ALTER TABLE t1_myisam ENGINE=INNODB;
ALTER TABLE t1_innodb ENGINE=MYISAM; ALTER TABLE t1_innodb ENGINE=MYISAM;
ALTER TABLE t2_myisam ENGINE=INNODB; ALTER TABLE t2_myisam ENGINE=INNODB;
ALTER TABLE t2_innodb ENGINE=MYISAM; ALTER TABLE t2_innodb ENGINE=MYISAM;
--enable_warnings
--echo **** On Master **** --echo **** On Master ****
connection master; connection master;
......
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
# Embedded server doesn't support binlogging # Embedded server doesn't support binlogging
-- source include/not_embedded.inc -- source include/not_embedded.inc
-- source include/master-slave.inc -- source include/master-slave.inc
# This test requires the cp932 charset compiled in
-- source include/have_cp932.inc
# Setup Section # Setup Section
# we need this for getting fixed timestamps inside of this test # we need this for getting fixed timestamps inside of this test
......
...@@ -7167,8 +7167,11 @@ DROP FUNCTION bug5274_f2| ...@@ -7167,8 +7167,11 @@ DROP FUNCTION bug5274_f2|
delimiter ;| delimiter ;|
drop table t1,t2; drop table t1,t2;
# Disable warnings to allow test run without InnoDB
--disable_warnings
CREATE TABLE t1 (a int auto_increment primary key) engine=MyISAM; CREATE TABLE t1 (a int auto_increment primary key) engine=MyISAM;
CREATE TABLE t2 (a int auto_increment primary key, b int) engine=innodb; CREATE TABLE t2 (a int auto_increment primary key, b int) engine=innodb;
--enable_warnings
set @a=0; set @a=0;
delimiter |; delimiter |;
......
...@@ -54,33 +54,18 @@ drop table t1; ...@@ -54,33 +54,18 @@ drop table t1;
# End of 4.1 tests # End of 4.1 tests
# Test for Bug#5507 "TRUNCATE should work with views" # Test for Bug#5507 "TRUNCATE should work with views"
#
# when it'll be fixed, the error should become 1347
# (test.v1' is not BASE TABLE)
#
create table t1 (s1 int); create table t1 (s1 int);
insert into t1 (s1) values (1), (2), (3), (4), (5); insert into t1 (s1) values (1), (2), (3), (4), (5);
create view v1 as select * from t1; create view v1 as select * from t1;
--error 1146
truncate table v1; truncate table v1;
select count(*) from t1; drop view v1;
drop table t1;
insert into t1 (s1) values (1), (2), (3), (4), (5);
create view v2 as select * from t1 where s1 > 3;
truncate table v2;
select * from t1;
select * from v2;
delete from t1;
# The following should fail
create table t2 (s1 int, s2 int);
create view v3 as select a.s1, b.s2 from t1 a join t2 b on a.s1 = b.s1 where a.s1 > 3;
--error 1395
truncate table v3;
# The following should fail
create view v4 as select * from t1 limit 1,1;
--error 1288
truncate table v4;
drop view v1, v2, v3, v4;
drop table t1, t2;
# End of 5.0 tests # End of 5.0 tests
...@@ -758,8 +758,8 @@ int ha_ndbcluster::set_ndb_value(NdbOperation *ndb_op, Field *field, ...@@ -758,8 +758,8 @@ int ha_ndbcluster::set_ndb_value(NdbOperation *ndb_op, Field *field,
DBUG_DUMP("value", (char*)&bits, pack_len); DBUG_DUMP("value", (char*)&bits, pack_len);
#ifdef WORDS_BIGENDIAN #ifdef WORDS_BIGENDIAN
/* store lsw first */ /* store lsw first */
bits = ((bits >> 32) & 0x00000000FFFFFFFF) bits = ((bits >> 32) & 0x00000000FFFFFFFFLL)
| ((bits << 32) & 0xFFFFFFFF00000000); | ((bits << 32) & 0xFFFFFFFF00000000LL);
#endif #endif
DBUG_RETURN(ndb_op->setValue(fieldnr, (char*)&bits) != 0); DBUG_RETURN(ndb_op->setValue(fieldnr, (char*)&bits) != 0);
} }
...@@ -3248,10 +3248,10 @@ void ndb_unpack_record(TABLE *table, NdbValue *value, ...@@ -3248,10 +3248,10 @@ void ndb_unpack_record(TABLE *table, NdbValue *value,
/* lsw is stored first */ /* lsw is stored first */
Uint32 *buf= (Uint32 *)(*value).rec->aRef(); Uint32 *buf= (Uint32 *)(*value).rec->aRef();
field_bit->Field_bit::store((((longlong)*buf) field_bit->Field_bit::store((((longlong)*buf)
& 0x000000000FFFFFFFF) & 0x000000000FFFFFFFFLL)
| |
((((longlong)*(buf+1)) << 32) ((((longlong)*(buf+1)) << 32)
& 0xFFFFFFFF00000000), & 0xFFFFFFFF00000000LL),
TRUE); TRUE);
#else #else
field_bit->Field_bit::store((longlong) field_bit->Field_bit::store((longlong)
......
...@@ -4726,7 +4726,7 @@ bool Item_func_match::fix_index() ...@@ -4726,7 +4726,7 @@ bool Item_func_match::fix_index()
for (keynr=0 ; keynr < table->s->keys ; keynr++) for (keynr=0 ; keynr < table->s->keys ; keynr++)
{ {
if ((table->key_info[keynr].flags & HA_FULLTEXT) && if ((table->key_info[keynr].flags & HA_FULLTEXT) &&
(table->keys_in_use_for_query.is_set(keynr))) (table->s->keys_in_use.is_set(keynr)))
{ {
ft_to_key[fts]=keynr; ft_to_key[fts]=keynr;
ft_cnt[fts]=0; ft_cnt[fts]=0;
......
...@@ -5914,8 +5914,8 @@ ER_FOREIGN_DUPLICATE_KEY 23000 S1009 ...@@ -5914,8 +5914,8 @@ ER_FOREIGN_DUPLICATE_KEY 23000 S1009
eng "Upholding foreign key constraints for table '%.192s', entry '%-.192s', key %d would lead to a duplicate entry" eng "Upholding foreign key constraints for table '%.192s', entry '%-.192s', key %d would lead to a duplicate entry"
ger "Aufrechterhalten der Fremdschlssel-Constraints fr Tabelle '%.192s', Eintrag '%-.192s', Schlssel %d wrde zu einem doppelten Eintrag fhren" ger "Aufrechterhalten der Fremdschlssel-Constraints fr Tabelle '%.192s', Eintrag '%-.192s', Schlssel %d wrde zu einem doppelten Eintrag fhren"
ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE
eng "Column count of mysql.%s is wrong. Expected %d, found %d. Created with MySQL %d, now running %d. Please use scripts/mysql_fix_privilege_tables" eng "Column count of mysql.%s is wrong. Expected %d, found %d. Created with MySQL %d, now running %d. Please use mysql_upgrade to fix this error."
ger "Spaltenanzahl von mysql.%s falsch. %d erwartet, aber %d erhalten. Erzeugt mit MySQL %d, jetzt unter %d. Bitte benutzen Sie scripts/mysql_fix_privilege_tables, um den Fehler zu beheben" ger "Spaltenanzahl von mysql.%s falsch. %d erwartet, aber %d erhalten. Erzeugt mit MySQL %d, jetzt unter %d. Bitte benutzen Sie mysql_upgrade, um den Fehler zu beheben"
ER_REMOVED_SPACES ER_REMOVED_SPACES
eng "Leading spaces are removed from name '%s'" eng "Leading spaces are removed from name '%s'"
ger "Fhrende Leerzeichen werden aus dem Namen '%s' entfernt" ger "Fhrende Leerzeichen werden aus dem Namen '%s' entfernt"
......
...@@ -394,8 +394,6 @@ bool mysql_prepare_delete(THD *thd, TABLE_LIST *table_list, Item **conds) ...@@ -394,8 +394,6 @@ bool mysql_prepare_delete(THD *thd, TABLE_LIST *table_list, Item **conds)
{ {
Item *fake_conds= 0; Item *fake_conds= 0;
SELECT_LEX *select_lex= &thd->lex->select_lex; SELECT_LEX *select_lex= &thd->lex->select_lex;
const char *operation = thd->lex->sql_command == SQLCOM_TRUNCATE ?
"TRUNCATE" : "DELETE";
DBUG_ENTER("mysql_prepare_delete"); DBUG_ENTER("mysql_prepare_delete");
List<Item> all_fields; List<Item> all_fields;
...@@ -410,14 +408,14 @@ bool mysql_prepare_delete(THD *thd, TABLE_LIST *table_list, Item **conds) ...@@ -410,14 +408,14 @@ bool mysql_prepare_delete(THD *thd, TABLE_LIST *table_list, Item **conds)
DBUG_RETURN(TRUE); DBUG_RETURN(TRUE);
if (!table_list->updatable || check_key_in_view(thd, table_list)) if (!table_list->updatable || check_key_in_view(thd, table_list))
{ {
my_error(ER_NON_UPDATABLE_TABLE, MYF(0), table_list->alias, operation); my_error(ER_NON_UPDATABLE_TABLE, MYF(0), table_list->alias, "DELETE");
DBUG_RETURN(TRUE); DBUG_RETURN(TRUE);
} }
{ {
TABLE_LIST *duplicate; TABLE_LIST *duplicate;
if ((duplicate= unique_table(thd, table_list, table_list->next_global, 0))) if ((duplicate= unique_table(thd, table_list, table_list->next_global, 0)))
{ {
update_non_unique_table_error(table_list, operation, duplicate); update_non_unique_table_error(table_list, "DELETE", duplicate);
DBUG_RETURN(TRUE); DBUG_RETURN(TRUE);
} }
} }
...@@ -935,8 +933,7 @@ bool mysql_truncate(THD *thd, TABLE_LIST *table_list, bool dont_send_ok) ...@@ -935,8 +933,7 @@ bool mysql_truncate(THD *thd, TABLE_LIST *table_list, bool dont_send_ok)
if (!dont_send_ok) if (!dont_send_ok)
{ {
enum legacy_db_type table_type; enum legacy_db_type table_type;
if (mysql_frm_type(thd, path, &table_type) == FRMTYPE_VIEW) mysql_frm_type(thd, path, &table_type);
goto trunc_by_del;
if (table_type == DB_TYPE_UNKNOWN) if (table_type == DB_TYPE_UNKNOWN)
{ {
my_error(ER_NO_SUCH_TABLE, MYF(0), my_error(ER_NO_SUCH_TABLE, MYF(0),
......
...@@ -1835,7 +1835,6 @@ bool st_lex::can_use_merged() ...@@ -1835,7 +1835,6 @@ bool st_lex::can_use_merged()
case SQLCOM_UPDATE_MULTI: case SQLCOM_UPDATE_MULTI:
case SQLCOM_DELETE: case SQLCOM_DELETE:
case SQLCOM_DELETE_MULTI: case SQLCOM_DELETE_MULTI:
case SQLCOM_TRUNCATE:
case SQLCOM_INSERT: case SQLCOM_INSERT:
case SQLCOM_INSERT_SELECT: case SQLCOM_INSERT_SELECT:
case SQLCOM_REPLACE: case SQLCOM_REPLACE:
......
...@@ -57,9 +57,9 @@ int mi_status(MI_INFO *info, register MI_ISAMINFO *x, uint flag) ...@@ -57,9 +57,9 @@ int mi_status(MI_INFO *info, register MI_ISAMINFO *x, uint flag)
x->keys = share->state.header.keys; x->keys = share->state.header.keys;
x->check_time = share->state.check_time; x->check_time = share->state.check_time;
x->mean_reclength = info->state->records ? x->mean_reclength= x->records ?
(ulong) ((info->state->data_file_length-info->state->empty)/ (ulong) ((x->data_file_length - x->delete_length) / x->records) :
info->state->records) : (ulong) share->min_pack_length; (ulong) share->min_pack_length;
} }
if (flag & HA_STATUS_ERRKEY) if (flag & HA_STATUS_ERRKEY)
{ {
......
...@@ -49,7 +49,7 @@ int mi_rkey(MI_INFO *info, byte *buf, int inx, const byte *key, ...@@ -49,7 +49,7 @@ int mi_rkey(MI_INFO *info, byte *buf, int inx, const byte *key,
key_buff=info->lastkey+info->s->base.max_key_length; key_buff=info->lastkey+info->s->base.max_key_length;
pack_key_length= keypart_map; pack_key_length= keypart_map;
bmove(key_buff, key, pack_key_length); bmove(key_buff, key, pack_key_length);
last_used_keyseg= 0; last_used_keyseg= info->s->keyinfo[inx].seg + info->last_used_keyseg;
} }
else else
{ {
...@@ -60,6 +60,8 @@ int mi_rkey(MI_INFO *info, byte *buf, int inx, const byte *key, ...@@ -60,6 +60,8 @@ int mi_rkey(MI_INFO *info, byte *buf, int inx, const byte *key,
keypart_map, &last_used_keyseg); keypart_map, &last_used_keyseg);
/* Save packed_key_length for use by the MERGE engine. */ /* Save packed_key_length for use by the MERGE engine. */
info->pack_key_length= pack_key_length; info->pack_key_length= pack_key_length;
info->last_used_keyseg= (uint16) (last_used_keyseg -
info->s->keyinfo[inx].seg);
DBUG_EXECUTE("key",_mi_print_key(DBUG_FILE, keyinfo->seg, DBUG_EXECUTE("key",_mi_print_key(DBUG_FILE, keyinfo->seg,
key_buff, pack_key_length);); key_buff, pack_key_length););
} }
......
...@@ -276,6 +276,7 @@ struct st_myisam_info { ...@@ -276,6 +276,7 @@ struct st_myisam_info {
enum ha_rkey_function last_key_func; /* CONTAIN, OVERLAP, etc */ enum ha_rkey_function last_key_func; /* CONTAIN, OVERLAP, etc */
uint save_lastkey_length; uint save_lastkey_length;
uint pack_key_length; /* For MYISAMMRG */ uint pack_key_length; /* For MYISAMMRG */
uint16 last_used_keyseg; /* For MyISAMMRG */
int errkey; /* Got last error on this key */ int errkey; /* Got last error on this key */
int lock_type; /* How database was locked */ int lock_type; /* How database was locked */
int tmp_lock_type; /* When locked by readinfo */ int tmp_lock_type; /* When locked by readinfo */
......
...@@ -40,12 +40,14 @@ int myrg_rkey(MYRG_INFO *info,byte *buf,int inx, const byte *key, ...@@ -40,12 +40,14 @@ int myrg_rkey(MYRG_INFO *info,byte *buf,int inx, const byte *key,
{ {
byte *key_buff; byte *key_buff;
uint pack_key_length; uint pack_key_length;
uint16 last_used_keyseg;
MYRG_TABLE *table; MYRG_TABLE *table;
MI_INFO *mi; MI_INFO *mi;
int err; int err;
DBUG_ENTER("myrg_rkey"); DBUG_ENTER("myrg_rkey");
LINT_INIT(key_buff); LINT_INIT(key_buff);
LINT_INIT(pack_key_length); LINT_INIT(pack_key_length);
LINT_INIT(last_used_keyseg);
if (_myrg_init_queue(info,inx,search_flag)) if (_myrg_init_queue(info,inx,search_flag))
DBUG_RETURN(my_errno); DBUG_RETURN(my_errno);
...@@ -60,10 +62,12 @@ int myrg_rkey(MYRG_INFO *info,byte *buf,int inx, const byte *key, ...@@ -60,10 +62,12 @@ int myrg_rkey(MYRG_INFO *info,byte *buf,int inx, const byte *key,
/* Get the saved packed key and packed key length. */ /* Get the saved packed key and packed key length. */
key_buff=(byte*) mi->lastkey+mi->s->base.max_key_length; key_buff=(byte*) mi->lastkey+mi->s->base.max_key_length;
pack_key_length=mi->pack_key_length; pack_key_length=mi->pack_key_length;
last_used_keyseg= mi->last_used_keyseg;
} }
else else
{ {
mi->once_flags|= USE_PACKED_KEYS; mi->once_flags|= USE_PACKED_KEYS;
mi->last_used_keyseg= last_used_keyseg;
err=mi_rkey(mi, 0, inx, key_buff, pack_key_length, search_flag); err=mi_rkey(mi, 0, inx, key_buff, pack_key_length, search_flag);
} }
info->last_used_table=table+1; info->last_used_table=table+1;
......
...@@ -1055,18 +1055,6 @@ class Ndb ...@@ -1055,18 +1055,6 @@ class Ndb
friend class NdbDictInterface; friend class NdbDictInterface;
friend class NdbBlob; friend class NdbBlob;
friend class NdbImpl; friend class NdbImpl;
friend class Ndb_free_list_t<NdbRecAttr>;
friend class Ndb_free_list_t<NdbApiSignal>;
friend class Ndb_free_list_t<NdbLabel>;
friend class Ndb_free_list_t<NdbBranch>;
friend class Ndb_free_list_t<NdbSubroutine>;
friend class Ndb_free_list_t<NdbCall>;
friend class Ndb_free_list_t<NdbBlob>;
friend class Ndb_free_list_t<NdbReceiver>;
friend class Ndb_free_list_t<NdbIndexScanOperation>;
friend class Ndb_free_list_t<NdbOperation>;
friend class Ndb_free_list_t<NdbIndexOperation>;
friend class Ndb_free_list_t<NdbTransaction>;
#endif #endif
public: public:
......
...@@ -96,6 +96,15 @@ public: ...@@ -96,6 +96,15 @@ public:
return 0; return 0;
} }
/*
We need this friend accessor function to work around a HP compiler problem,
where template class friends are not working.
*/
static inline void setNdbError(Ndb &ndb,int code){
ndb.theError.code = code;
return;
}
BaseString m_systemPrefix; // Buffer for preformatted for <sys>/<def>/ BaseString m_systemPrefix; // Buffer for preformatted for <sys>/<def>/
/** /**
...@@ -217,7 +226,7 @@ Ndb_free_list_t<T>::fill(Ndb* ndb, Uint32 cnt) ...@@ -217,7 +226,7 @@ Ndb_free_list_t<T>::fill(Ndb* ndb, Uint32 cnt)
m_free_list = new T(ndb); m_free_list = new T(ndb);
if (m_free_list == 0) if (m_free_list == 0)
{ {
ndb->theError.code = 4000; NdbImpl::setNdbError(*ndb, 4000);
assert(false); assert(false);
return -1; return -1;
} }
...@@ -227,7 +236,7 @@ Ndb_free_list_t<T>::fill(Ndb* ndb, Uint32 cnt) ...@@ -227,7 +236,7 @@ Ndb_free_list_t<T>::fill(Ndb* ndb, Uint32 cnt)
T* obj= new T(ndb); T* obj= new T(ndb);
if(obj == 0) if(obj == 0)
{ {
ndb->theError.code = 4000; NdbImpl::setNdbError(*ndb, 4000);
assert(false); assert(false);
return -1; return -1;
} }
...@@ -259,7 +268,7 @@ Ndb_free_list_t<T>::seize(Ndb* ndb) ...@@ -259,7 +268,7 @@ Ndb_free_list_t<T>::seize(Ndb* ndb)
} }
else else
{ {
ndb->theError.code = 4000; NdbImpl::setNdbError(*ndb, 4000);
assert(false); assert(false);
} }
return tmp; return tmp;
......
/* Copyright (C) 2007, Justin He, MySQL AB /* Copyright (C) 2007 MySQL AB
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
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; version 2 of the License.
(at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
......
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