summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <holyfoot/hf@hfmain.(none)>2006-12-31 12:41:42 +0400
committerunknown <holyfoot/hf@hfmain.(none)>2006-12-31 12:41:42 +0400
commitcbff25d04ae0d72c2a42d78aea33764d0818808e (patch)
tree141237cc110455e8b067a8fc14d520bdf40aa4bf
parentd73b5b8e83c1ae52e35e73d0338c296b9383e2b4 (diff)
parenta2fc58745115a17a8e12a9c46c9631e6d9576551 (diff)
downloadmariadb-git-cbff25d04ae0d72c2a42d78aea33764d0818808e.tar.gz
Merge mysql.com:/d2/hf/clean/my51-clean
into mysql.com:/d2/hf/common/my51-common libmysqld/Makefile.am: Auto merged libmysqld/lib_sql.cc: Auto merged mysql-test/mysql-test-run.pl: Auto merged mysql-test/t/ps.test: Auto merged sql/item_func.cc: Auto merged sql/item_strfunc.cc: Auto merged sql/share/errmsg.txt: Auto merged sql/sql_insert.cc: Auto merged BitKeeper/deleted/.del-ps_not_windows.test: Auto merged storage/myisam/ha_myisam.cc: Auto merged
-rw-r--r--BitKeeper/etc/gone2
-rw-r--r--config/ac-macros/plugins.m42
-rw-r--r--libmysqld/Makefile.am28
-rwxr-xr-xlibmysqld/examples/test-run2
-rw-r--r--libmysqld/lib_sql.cc8
-rw-r--r--mysql-test/include/federated.inc1
-rw-r--r--mysql-test/r/flush_block_commit.result15
-rw-r--r--mysql-test/r/flush_block_commit_notembedded.result15
-rw-r--r--mysql-test/r/insert.result6
-rw-r--r--mysql-test/r/insert_notembedded.result107
-rw-r--r--mysql-test/r/insert_select.result100
-rw-r--r--mysql-test/t/backup.test3
-rw-r--r--mysql-test/t/crash_commit_before.test1
-rw-r--r--mysql-test/t/csv.test1
-rw-r--r--mysql-test/t/delayed.test5
-rw-r--r--mysql-test/t/execution_constants.test3
-rw-r--r--mysql-test/t/flush_block_commit.test21
-rw-r--r--mysql-test/t/flush_block_commit_notembedded.test32
-rw-r--r--mysql-test/t/information_schema_db.test4
-rw-r--r--mysql-test/t/innodb.test1
-rw-r--r--mysql-test/t/insert.test10
-rw-r--r--mysql-test/t/insert_notembedded.test154
-rw-r--r--mysql-test/t/insert_select.test137
-rw-r--r--mysql-test/t/join.test1
-rw-r--r--mysql-test/t/lock_multi.test1
-rw-r--r--mysql-test/t/ps.test1
-rw-r--r--mysql-test/t/ps_1general.test2
-rw-r--r--mysql-test/t/status.test3
-rw-r--r--mysql-test/t/trigger.test1
-rw-r--r--sql/item_func.cc4
-rw-r--r--sql/item_strfunc.cc7
-rw-r--r--sql/share/errmsg.txt4
-rw-r--r--sql/sql_insert.cc2
-rw-r--r--storage/myisam/ha_myisam.cc6
34 files changed, 384 insertions, 306 deletions
diff --git a/BitKeeper/etc/gone b/BitKeeper/etc/gone
index 5964232680e..80830a01906 100644
--- a/BitKeeper/etc/gone
+++ b/BitKeeper/etc/gone
@@ -456,6 +456,8 @@ arjen@fred.bitbike.com|scripts/mysql_fix_extensions.sh|20020516001337|12363|f104
ccarkner@nslinuxw10.bedford.progress.com|mysql-test/r/isolation.result|20010327145543|25059|4da11e109a3d93a9
ccarkner@nslinuxw10.bedford.progress.com|mysql-test/t/isolation.test|20010327145543|39049|6a39e4138dd4a456
fs
+holyfoot/hf@mysql.com/deer.(none)|mysql-test/r/bdb_notembedded.result|20061113160642|60022|276fa5181da9a588
+holyfoot/hf@mysql.com/deer.(none)|mysql-test/t/bdb_notembedded.test|20061113160642|06094|6ef2ea4713496614
jani@hynda.mysql.fi|client/mysqlcheck|20010419221207|26716|363e3278166d84ec
jcole@tetra.bedford.progress.com|BitKeeper/etc/logging_ok|20001004201211|30554
jimw@mysql.com|mysql-test/t/ndb_alter_table.disabled|20050311230559|27526|411e026940e7a0aa
diff --git a/config/ac-macros/plugins.m4 b/config/ac-macros/plugins.m4
index b022ab67045..48754563992 100644
--- a/config/ac-macros/plugins.m4
+++ b/config/ac-macros/plugins.m4
@@ -306,6 +306,7 @@ AC_DEFUN([MYSQL_CONFIGURE_PLUGINS],[
AC_SUBST([mysql_se_unittest_dirs])
AC_SUBST([mysql_pg_unittest_dirs])
AC_SUBST([condition_dependent_plugin_modules])
+ AC_SUBST([condition_dependent_plugin_objects])
AC_SUBST([condition_dependent_plugin_links])
AC_SUBST([condition_dependent_plugin_includes])
])
@@ -431,6 +432,7 @@ dnl Although this is "pretty", it breaks libmysqld build
AC_MSG_RESULT([yes])
m4_ifdef([$11],[
condition_dependent_plugin_modules="$condition_dependent_plugin_modules m4_bregexp($11, [[^/]+$], [\&])"
+ condition_dependent_plugin_objects="$condition_dependent_plugin_objects m4_bregexp($11, [[^/]+\.], [\&o])"
condition_dependent_plugin_links="$condition_dependent_plugin_links $6/$11"
condition_dependent_plugin_includes="$condition_dependent_plugin_includes -I[\$(top_srcdir)]/$6/m4_bregexp($11, [^.+[/$]], [\&])"
])
diff --git a/libmysqld/Makefile.am b/libmysqld/Makefile.am
index 374f2e61e72..a0a041d2f8d 100644
--- a/libmysqld/Makefile.am
+++ b/libmysqld/Makefile.am
@@ -80,6 +80,7 @@ libmysqld_a_SOURCES=
sqlstoragesources = $(EXTRA_libmysqld_a_SOURCES)
storagesources = @condition_dependent_plugin_modules@
+storageobjects = @condition_dependent_plugin_objects@
storagesourceslinks = @condition_dependent_plugin_links@
# automake misses these
@@ -110,6 +111,24 @@ ha_ndbcluster_binlog.o: ha_ndbcluster_binlog.cc
handler.o: handler.cc
$(CXXCOMPILE) @ndbcluster_includes@ $(LM_CFLAGS) -c $<
+# We need rules to compile these as no good way
+# found to append fileslists that collected by configure
+# to the sources list
+
+ha_federated.o:ha_federated.cc
+ $(CXXCOMPILE) $(LM_CFLAGS) -c $<
+
+ha_heap.o:ha_heap.cc
+ $(CXXCOMPILE) $(LM_CFLAGS) -c $<
+
+ha_innodb.o:ha_innodb.cc
+ $(CXXCOMPILE) $(LM_CFLAGS) -c $<
+
+ha_myisam.o:ha_myisam.cc
+ $(CXXCOMPILE) $(LM_CFLAGS) -c $<
+
+ha_myisammrg.o:ha_myisammrg.cc
+ $(CXXCOMPILE) $(LM_CFLAGS) -c $<
#
# To make it easy for the end user to use the embedded library we
@@ -121,18 +140,18 @@ handler.o: handler.cc
# need to add the same file twice to the library, so 'sort -u' save us
# some time and spares unnecessary work.
-libmysqld.a: libmysqld_int.a $(INC_LIB) $(libmysqld_a_DEPENDENCIES)
+libmysqld.a: libmysqld_int.a $(INC_LIB) $(libmysqld_a_DEPENDENCIES) $(storageobjects)
if DARWIN_MWCC
- mwld -lib -o $@ libmysqld_int.a `echo $(INC_LIB) | sort -u`
+ mwld -lib -o $@ libmysqld_int.a `echo $(INC_LIB) | sort -u` $(storageobjects)
else
-rm -f libmysqld.a
if test "$(host_os)" = "netware" ; \
then \
- $(libmysqld_a_AR) libmysqld.a libmysqld_int.a $(INC_LIB) ; \
+ $(libmysqld_a_AR) libmysqld.a $(INC_LIB) libmysqld_int.a $(storageobjects); \
else \
current_dir=`pwd`; \
rm -rf tmp; mkdir tmp; \
- (for arc in ./libmysqld_int.a $(INC_LIB); do \
+ (for arc in $(INC_LIB) ./libmysqld_int.a; do \
arpath=`echo $$arc|sed 's|[^/]*$$||'|sed 's|\.libs/$$||'`; \
artmp=`echo $$arc|sed 's|^.*/|tmp/lib-|'`; \
for F in `$(AR) t $$arc | grep -v SYMDEF`; do \
@@ -143,6 +162,7 @@ else
ls $$artmp/* | grep -v SYMDEF; \
continue 2; fi; done; \
done; echo $(libmysqld_a_DEPENDENCIES) ) | sort -u | xargs $(AR) cq libmysqld.a ; \
+ $(AR) r libmysqld.a $(storageobjects); \
$(RANLIB) libmysqld.a ; \
rm -rf tmp; \
fi
diff --git a/libmysqld/examples/test-run b/libmysqld/examples/test-run
index c7434488259..aea5b13eaba 100755
--- a/libmysqld/examples/test-run
+++ b/libmysqld/examples/test-run
@@ -10,7 +10,7 @@
top_builddir=../..
mysql_test_dir=$top_builddir/mysql-test
examples=$top_builddir/libmysqld/examples
-mysqltest=$examples/mysqltest
+mysqltest=$examples/mysqltest_embedded
datadir=$mysql_test_dir/var/master-data
test_data_dir=test
gdb=0
diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc
index 9251ddd421a..b339cb5521b 100644
--- a/libmysqld/lib_sql.cc
+++ b/libmysqld/lib_sql.cc
@@ -542,6 +542,7 @@ int init_embedded_server(int argc, char **argv, char **groups)
}
}
+ execute_ddl_log_recovery();
return 0;
}
@@ -549,6 +550,7 @@ void end_embedded_server()
{
my_free((char*) copy_arguments_ptr, MYF(MY_ALLOW_ZERO_PTR));
copy_arguments_ptr=0;
+ release_ddl_log();
clean_up(0);
}
@@ -586,6 +588,7 @@ void *create_embedded_thd(int client_flag)
thd->set_time();
thd->init_for_queries();
thd->client_capabilities= client_flag;
+ thd->real_id= (pthread_t) thd;
thd->db= NULL;
thd->db_length= 0;
@@ -771,6 +774,8 @@ MYSQL_DATA *THD::alloc_new_dataset()
static void write_eof_packet(THD *thd)
{
+ if (!thd->mysql) // bootstrap file handling
+ return;
/*
The following test should never be true, but it's better to do it
because if 'is_fatal_error' is set the server is not going to execute
@@ -1030,6 +1035,9 @@ void Protocol_simple::prepare_for_resend()
MYSQL_DATA *data= thd->cur_data;
DBUG_ENTER("send_data");
+ if (!thd->mysql) // bootstrap file handling
+ DBUG_VOID_RETURN;
+
data->rows++;
if (!(cur= (MYSQL_ROWS *)alloc_root(alloc, sizeof(MYSQL_ROWS)+(field_count + 1) * sizeof(char *))))
{
diff --git a/mysql-test/include/federated.inc b/mysql-test/include/federated.inc
index 15230f47ed8..c8e8ededa11 100644
--- a/mysql-test/include/federated.inc
+++ b/mysql-test/include/federated.inc
@@ -1,3 +1,4 @@
+--source include/not_embedded.inc
--source ./include/have_federated_db.inc
source ./include/master-slave.inc;
diff --git a/mysql-test/r/flush_block_commit.result b/mysql-test/r/flush_block_commit.result
index 56f8acab896..d5b10868358 100644
--- a/mysql-test/r/flush_block_commit.result
+++ b/mysql-test/r/flush_block_commit.result
@@ -37,18 +37,3 @@ show create database test;
Database Create Database
test CREATE DATABASE `test` /*!40100 DEFAULT CHARACTER SET latin1 */
drop table t1;
-create table t1 (a int) engine=innodb;
-reset master;
-set autocommit=0;
-insert t1 values (1);
-flush tables with read lock;
-show master status;
-File Position Binlog_Do_DB Binlog_Ignore_DB
-master-bin.000001 102
-commit;
-show master status;
-File Position Binlog_Do_DB Binlog_Ignore_DB
-master-bin.000001 102
-unlock tables;
-drop table t1;
-set autocommit=1;
diff --git a/mysql-test/r/flush_block_commit_notembedded.result b/mysql-test/r/flush_block_commit_notembedded.result
new file mode 100644
index 00000000000..1d045b21763
--- /dev/null
+++ b/mysql-test/r/flush_block_commit_notembedded.result
@@ -0,0 +1,15 @@
+create table t1 (a int) engine=innodb;
+reset master;
+set autocommit=0;
+insert t1 values (1);
+flush tables with read lock;
+show master status;
+File Position Binlog_Do_DB Binlog_Ignore_DB
+master-bin.000001 102
+commit;
+show master status;
+File Position Binlog_Do_DB Binlog_Ignore_DB
+master-bin.000001 102
+unlock tables;
+drop table t1;
+set autocommit=1;
diff --git a/mysql-test/r/insert.result b/mysql-test/r/insert.result
index b090f0f52c0..ef2ed6f0acf 100644
--- a/mysql-test/r/insert.result
+++ b/mysql-test/r/insert.result
@@ -321,12 +321,6 @@ ERROR 42000: Column 'b' specified twice
INSERT INTO t1 (b,b) SELECT 0,0 ON DUPLICATE KEY UPDATE a = a + VALUES (a);
ERROR 42000: Column 'b' specified twice
drop table t1;
-create table t1 (n int);
-create view v1 as select * from t1;
-insert delayed into v1 values (1);
-ERROR HY000: 'test.v1' is not BASE TABLE
-drop table t1;
-drop view v1;
create table t1 (id int primary key, data int);
insert into t1 values (1, 1), (2, 2), (3, 3);
select row_count();
diff --git a/mysql-test/r/insert_notembedded.result b/mysql-test/r/insert_notembedded.result
new file mode 100644
index 00000000000..816060b7ec9
--- /dev/null
+++ b/mysql-test/r/insert_notembedded.result
@@ -0,0 +1,107 @@
+drop table if exists t1;
+create table t1 (n int);
+create view v1 as select * from t1;
+insert delayed into v1 values (1);
+ERROR HY000: 'test.v1' is not BASE TABLE
+drop table t1;
+drop view v1;
+CREATE DATABASE meow;
+CREATE TABLE table_target ( mexs_id CHAR(8), messzeit TIMESTAMP, PRIMARY KEY (mexs_id));
+CREATE TABLE table_target2 ( mexs_id CHAR(8), messzeit TIMESTAMP, PRIMARY KEY (mexs_id));
+CREATE TABLE table_target3 ( mexs_id CHAR(8), messzeit TIMESTAMP, PRIMARY KEY (mexs_id));
+CREATE VIEW view_target2 AS SELECT mexs_id,messzeit FROM table_target2;
+CREATE SQL SECURITY INVOKER VIEW view_target3 AS SELECT mexs_id,messzeit FROM table_target3;
+CREATE TABLE table_stations ( mexs_id VARCHAR(8), icao VARCHAR(4), country CHAR(2), PRIMARY KEY (mexs_id), UNIQUE KEY icao (icao), KEY country (country), CONSTRAINT stations_ibfk_8 FOREIGN KEY (country) REFERENCES countries (country) ON UPDATE CASCADE);
+INSERT INTO table_stations VALUES ('87654321','XXXX','YY');
+CREATE TABLE table_countries ( country CHAR(2), iso_short_en VARCHAR(64), PRIMARY KEY (country));
+INSERT INTO table_countries VALUES ('YY','Entenhausen');
+CREATE ALGORITHM=MERGE SQL SECURITY INVOKER VIEW view_stations AS select table_stations.mexs_id AS mexs_id, table_stations.icao AS icao, table_stations.country AS landescode from (table_stations join table_countries on((table_stations.country = table_countries.country)));
+CREATE TABLE table_source ( id varchar(4), datetime TIMESTAMP, PRIMARY KEY (id));
+INSERT INTO table_source VALUES ('XXXX','2006-07-12 07:50:00');
+GRANT SELECT ON table_source TO user20989@localhost;
+GRANT SELECT ON table_countries TO user20989@localhost;
+GRANT SELECT ON table_stations TO user20989@localhost;
+GRANT SELECT ON view_stations TO user20989@localhost;
+GRANT SELECT ON table_target TO user20989@localhost;
+GRANT SELECT ON table_target2 TO user20989@localhost;
+GRANT INSERT,DELETE,SELECT ON view_target3 TO user20989@localhost;
+REPLACE INTO table_target
+SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
+FROM table_source
+INNER JOIN view_stations AS stations
+ON table_source.id = stations.icao
+LEFT JOIN table_target AS old
+USING (mexs_id);
+ERROR 42000: INSERT,DELETE command denied to user 'user20989'@'localhost' for table 'table_target'
+REPLACE INTO view_target2
+SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
+FROM table_source
+INNER JOIN view_stations AS stations
+ON table_source.id = stations.icao
+LEFT JOIN view_target2 AS old
+USING (mexs_id);
+ERROR 42000: INSERT,DELETE command denied to user 'user20989'@'localhost' for table 'view_target2'
+REPLACE INTO view_target3
+SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
+FROM table_source
+INNER JOIN view_stations AS stations
+ON table_source.id = stations.icao
+LEFT JOIN view_target3 AS old
+USING (mexs_id);
+ERROR HY000: View 'meow.view_target3' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+GRANT INSERT,DELETE ON table_target TO user20989@localhost;
+GRANT INSERT,DELETE,SELECT ON view_target2 TO user20989@localhost;
+GRANT INSERT,DELETE,SELECT ON table_target3 TO user20989@localhost;
+REPLACE INTO table_target
+SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
+FROM table_source
+INNER JOIN view_stations AS stations
+ON table_source.id = stations.icao
+LEFT JOIN table_target AS old
+USING (mexs_id);
+REPLACE INTO table_target2 VALUES ('00X45Y78','2006-07-12 07:50:00');
+ERROR 42000: INSERT,DELETE command denied to user 'user20989'@'localhost' for table 'table_target2'
+REPLACE INTO view_target2 VALUES ('12X45Y78','2006-07-12 07:50:00');
+SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
+FROM table_source
+INNER JOIN view_stations AS stations
+ON table_source.id = stations.icao
+LEFT JOIN view_target2 AS old
+USING (mexs_id);
+mexs_id messzeit
+87654321 2006-07-12 07:50:00
+REPLACE INTO view_target2
+SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
+FROM table_source
+INNER JOIN view_stations AS stations
+ON table_source.id = stations.icao
+LEFT JOIN view_target2 AS old
+USING (mexs_id);
+REPLACE INTO view_target3
+SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
+FROM table_source
+INNER JOIN view_stations AS stations
+ON table_source.id = stations.icao
+LEFT JOIN view_target3 AS old
+USING (mexs_id);
+SELECT * FROM table_target;
+mexs_id messzeit
+87654321 2006-07-12 07:50:00
+SELECT * FROM view_target2;
+mexs_id messzeit
+12X45Y78 2006-07-12 07:50:00
+87654321 2006-07-12 07:50:00
+SELECT * FROM view_target3;
+mexs_id messzeit
+87654321 2006-07-12 07:50:00
+DROP VIEW view_stations;
+DROP TABLE table_source;
+DROP TABLE table_countries;
+DROP TABLE table_stations;
+DROP TABLE table_target;
+DROP TABLE table_target2;
+DROP TABLE table_target3;
+DROP VIEW view_target2;
+DROP VIEW view_target3;
+DROP USER user20989@localhost;
+DROP DATABASE meow;
diff --git a/mysql-test/r/insert_select.result b/mysql-test/r/insert_select.result
index 95ada9d37be..b6c02869914 100644
--- a/mysql-test/r/insert_select.result
+++ b/mysql-test/r/insert_select.result
@@ -705,103 +705,3 @@ use bug21774_1;
INSERT INTO bug21774_2.t1 SELECT t1.* FROM t1;
DROP DATABASE bug21774_1;
DROP DATABASE bug21774_2;
-CREATE DATABASE meow;
-CREATE TABLE table_target ( mexs_id CHAR(8), messzeit TIMESTAMP, PRIMARY KEY (mexs_id));
-CREATE TABLE table_target2 ( mexs_id CHAR(8), messzeit TIMESTAMP, PRIMARY KEY (mexs_id));
-CREATE TABLE table_target3 ( mexs_id CHAR(8), messzeit TIMESTAMP, PRIMARY KEY (mexs_id));
-CREATE VIEW view_target2 AS SELECT mexs_id,messzeit FROM table_target2;
-CREATE SQL SECURITY INVOKER VIEW view_target3 AS SELECT mexs_id,messzeit FROM table_target3;
-CREATE TABLE table_stations ( mexs_id VARCHAR(8), icao VARCHAR(4), country CHAR(2), PRIMARY KEY (mexs_id), UNIQUE KEY icao (icao), KEY country (country), CONSTRAINT stations_ibfk_8 FOREIGN KEY (country) REFERENCES countries (country) ON UPDATE CASCADE);
-INSERT INTO table_stations VALUES ('87654321','XXXX','YY');
-CREATE TABLE table_countries ( country CHAR(2), iso_short_en VARCHAR(64), PRIMARY KEY (country));
-INSERT INTO table_countries VALUES ('YY','Entenhausen');
-CREATE ALGORITHM=MERGE SQL SECURITY INVOKER VIEW view_stations AS select table_stations.mexs_id AS mexs_id, table_stations.icao AS icao, table_stations.country AS landescode from (table_stations join table_countries on((table_stations.country = table_countries.country)));
-CREATE TABLE table_source ( id varchar(4), datetime TIMESTAMP, PRIMARY KEY (id));
-INSERT INTO table_source VALUES ('XXXX','2006-07-12 07:50:00');
-GRANT SELECT ON table_source TO user20989@localhost;
-GRANT SELECT ON table_countries TO user20989@localhost;
-GRANT SELECT ON table_stations TO user20989@localhost;
-GRANT SELECT ON view_stations TO user20989@localhost;
-GRANT SELECT ON table_target TO user20989@localhost;
-GRANT SELECT ON table_target2 TO user20989@localhost;
-GRANT INSERT,DELETE,SELECT ON view_target3 TO user20989@localhost;
-REPLACE INTO table_target
-SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
-FROM table_source
-INNER JOIN view_stations AS stations
-ON table_source.id = stations.icao
-LEFT JOIN table_target AS old
-USING (mexs_id);
-ERROR 42000: INSERT,DELETE command denied to user 'user20989'@'localhost' for table 'table_target'
-REPLACE INTO view_target2
-SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
-FROM table_source
-INNER JOIN view_stations AS stations
-ON table_source.id = stations.icao
-LEFT JOIN view_target2 AS old
-USING (mexs_id);
-ERROR 42000: INSERT,DELETE command denied to user 'user20989'@'localhost' for table 'view_target2'
-REPLACE INTO view_target3
-SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
-FROM table_source
-INNER JOIN view_stations AS stations
-ON table_source.id = stations.icao
-LEFT JOIN view_target3 AS old
-USING (mexs_id);
-ERROR HY000: View 'meow.view_target3' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
-GRANT INSERT,DELETE ON table_target TO user20989@localhost;
-GRANT INSERT,DELETE,SELECT ON view_target2 TO user20989@localhost;
-GRANT INSERT,DELETE,SELECT ON table_target3 TO user20989@localhost;
-REPLACE INTO table_target
-SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
-FROM table_source
-INNER JOIN view_stations AS stations
-ON table_source.id = stations.icao
-LEFT JOIN table_target AS old
-USING (mexs_id);
-REPLACE INTO table_target2 VALUES ('00X45Y78','2006-07-12 07:50:00');
-ERROR 42000: INSERT,DELETE command denied to user 'user20989'@'localhost' for table 'table_target2'
-REPLACE INTO view_target2 VALUES ('12X45Y78','2006-07-12 07:50:00');
-SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
-FROM table_source
-INNER JOIN view_stations AS stations
-ON table_source.id = stations.icao
-LEFT JOIN view_target2 AS old
-USING (mexs_id);
-mexs_id messzeit
-87654321 2006-07-12 07:50:00
-REPLACE INTO view_target2
-SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
-FROM table_source
-INNER JOIN view_stations AS stations
-ON table_source.id = stations.icao
-LEFT JOIN view_target2 AS old
-USING (mexs_id);
-REPLACE INTO view_target3
-SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
-FROM table_source
-INNER JOIN view_stations AS stations
-ON table_source.id = stations.icao
-LEFT JOIN view_target3 AS old
-USING (mexs_id);
-SELECT * FROM table_target;
-mexs_id messzeit
-87654321 2006-07-12 07:50:00
-SELECT * FROM view_target2;
-mexs_id messzeit
-12X45Y78 2006-07-12 07:50:00
-87654321 2006-07-12 07:50:00
-SELECT * FROM view_target3;
-mexs_id messzeit
-87654321 2006-07-12 07:50:00
-DROP VIEW view_stations;
-DROP TABLE table_source;
-DROP TABLE table_countries;
-DROP TABLE table_stations;
-DROP TABLE table_target;
-DROP TABLE table_target2;
-DROP TABLE table_target3;
-DROP VIEW view_target2;
-DROP VIEW view_target3;
-DROP USER user20989@localhost;
-DROP DATABASE meow;
diff --git a/mysql-test/t/backup.test b/mysql-test/t/backup.test
index 61bde0cecb0..d737e292bb1 100644
--- a/mysql-test/t/backup.test
+++ b/mysql-test/t/backup.test
@@ -1,6 +1,3 @@
-# This test should work in embedded server after we fix mysqltest
--- source include/not_embedded.inc
-
#
# This test is a bit tricky as we can't use backup table to overwrite an old
# table
diff --git a/mysql-test/t/crash_commit_before.test b/mysql-test/t/crash_commit_before.test
index 757817915dd..5a91cd7a7ad 100644
--- a/mysql-test/t/crash_commit_before.test
+++ b/mysql-test/t/crash_commit_before.test
@@ -1,3 +1,4 @@
+-- source include/not_embedded.inc
# Don't test this under valgrind, memory leaks will occur
--source include/not_valgrind.inc
diff --git a/mysql-test/t/csv.test b/mysql-test/t/csv.test
index 60d38394fc0..22e533e2655 100644
--- a/mysql-test/t/csv.test
+++ b/mysql-test/t/csv.test
@@ -1575,6 +1575,7 @@ create table bug15205 (val int(11) default null) engine=csv;
create table bug15205_2 (val int(11) default null) engine=csv;
--exec rm $MYSQLTEST_VARDIR/master-data/test/bug15205.CSV
# system error (can't open the datafile)
+--replace_result $MYSQLTEST_VARDIR . master-data/ ''
--error 13
select * from bug15205;
select * from bug15205_2;
diff --git a/mysql-test/t/delayed.test b/mysql-test/t/delayed.test
index 03d8e20dd8f..fe8bc167e0f 100644
--- a/mysql-test/t/delayed.test
+++ b/mysql-test/t/delayed.test
@@ -1,11 +1,10 @@
+# delayed works differently in embedded server
+--source include/not_embedded.inc
#
# test of DELAYED insert and timestamps
# (Can't be tested with purify :( )
#
-# This tests not performed with embedded server
--- source include/not_embedded.inc
-
--disable_warnings
drop table if exists t1;
--enable_warnings
diff --git a/mysql-test/t/execution_constants.test b/mysql-test/t/execution_constants.test
index 00967b2eeba..4930164d3fa 100644
--- a/mysql-test/t/execution_constants.test
+++ b/mysql-test/t/execution_constants.test
@@ -1,3 +1,6 @@
+# In embedded server we don't really have a control over stack usage
+-- source include/not_embedded.inc
+
#
# Bug#21476: Lost Database Connection During Query
#
diff --git a/mysql-test/t/flush_block_commit.test b/mysql-test/t/flush_block_commit.test
index 4412b2c357c..0c1d2b82df6 100644
--- a/mysql-test/t/flush_block_commit.test
+++ b/mysql-test/t/flush_block_commit.test
@@ -75,24 +75,3 @@ show create database test;
drop table t1;
# End of 4.1 tests
-
-# FLUSH TABLES WITH READ LOCK should block writes to binlog too
-connection con1;
-create table t1 (a int) engine=innodb;
-reset master;
-set autocommit=0;
-insert t1 values (1);
-connection con2;
-flush tables with read lock;
-show master status;
-connection con1;
-send commit;
-connection con2;
-sleep 1;
-show master status;
-unlock tables;
-connection con1;
-reap;
-drop table t1;
-set autocommit=1;
-
diff --git a/mysql-test/t/flush_block_commit_notembedded.test b/mysql-test/t/flush_block_commit_notembedded.test
new file mode 100644
index 00000000000..4650a5a15a8
--- /dev/null
+++ b/mysql-test/t/flush_block_commit_notembedded.test
@@ -0,0 +1,32 @@
+# Let's see if FLUSH TABLES WITH READ LOCK blocks COMMIT of existing
+# transactions.
+# We verify that we did not introduce a deadlock.
+# This is intended to mimick how mysqldump and innobackup work.
+
+# And it requires InnoDB
+-- source include/not_embedded.inc
+-- source include/have_innodb.inc
+
+connect (con1,localhost,root,,);
+connect (con2,localhost,root,,);
+
+# FLUSH TABLES WITH READ LOCK should block writes to binlog too
+connection con1;
+create table t1 (a int) engine=innodb;
+reset master;
+set autocommit=0;
+insert t1 values (1);
+connection con2;
+flush tables with read lock;
+show master status;
+connection con1;
+send commit;
+connection con2;
+sleep 1;
+show master status;
+unlock tables;
+connection con1;
+reap;
+drop table t1;
+set autocommit=1;
+
diff --git a/mysql-test/t/information_schema_db.test b/mysql-test/t/information_schema_db.test
index 4dfe1ad56b5..e15e50e8766 100644
--- a/mysql-test/t/information_schema_db.test
+++ b/mysql-test/t/information_schema_db.test
@@ -1,3 +1,7 @@
+# this test mostly test privilege control (what doesn't work
+# in the embedded server by default). So disabled in embedded-server mode
+-- source include/not_embedded.inc
+
-- source include/testdb_only.inc
--disable_warnings
diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test
index 7e9a0e1ed18..e1e74ac8a11 100644
--- a/mysql-test/t/innodb.test
+++ b/mysql-test/t/innodb.test
@@ -11,6 +11,7 @@
# #
#######################################################################
+-- source include/not_embedded.inc
-- source include/have_innodb.inc
#
diff --git a/mysql-test/t/insert.test b/mysql-test/t/insert.test
index 0cc25469705..398b0bc89d8 100644
--- a/mysql-test/t/insert.test
+++ b/mysql-test/t/insert.test
@@ -201,16 +201,6 @@ insert into t1 (b,b) select 1,2;
--error 1110
INSERT INTO t1 (b,b) SELECT 0,0 ON DUPLICATE KEY UPDATE a = a + VALUES (a);
drop table t1;
-# Test for INSERT DELAYED INTO a <view>
-# BUG#13683: INSERT DELAYED into a view creates an infinite loop
-#
-
-create table t1 (n int);
-create view v1 as select * from t1;
---error 1347
-insert delayed into v1 values (1);
-drop table t1;
-drop view v1;
#
# Test for values returned by ROW_COUNT() function
diff --git a/mysql-test/t/insert_notembedded.test b/mysql-test/t/insert_notembedded.test
new file mode 100644
index 00000000000..bdea72e9eca
--- /dev/null
+++ b/mysql-test/t/insert_notembedded.test
@@ -0,0 +1,154 @@
+-- source include/not_embedded.inc
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+
+# Test for INSERT DELAYED INTO a <view>
+# BUG#13683: INSERT DELAYED into a view creates an infinite loop
+#
+
+create table t1 (n int);
+create view v1 as select * from t1;
+--error 1347
+insert delayed into v1 values (1);
+drop table t1;
+drop view v1;
+
+#
+# Bug #20989: View '(null).(null)' references invalid table(s)... on
+# SQL SECURITY INVOKER
+#
+# this is really the fact that REPLACE ... SELECT required additional
+# INSERT privs (on tables that are part of a view) over the related
+# REPLACE, SELECT
+#
+
+CREATE DATABASE meow;
+
+connect (root,localhost,root,,meow);
+connection root;
+
+CREATE TABLE table_target ( mexs_id CHAR(8), messzeit TIMESTAMP, PRIMARY KEY (mexs_id));
+CREATE TABLE table_target2 ( mexs_id CHAR(8), messzeit TIMESTAMP, PRIMARY KEY (mexs_id));
+CREATE TABLE table_target3 ( mexs_id CHAR(8), messzeit TIMESTAMP, PRIMARY KEY (mexs_id));
+CREATE VIEW view_target2 AS SELECT mexs_id,messzeit FROM table_target2;
+CREATE SQL SECURITY INVOKER VIEW view_target3 AS SELECT mexs_id,messzeit FROM table_target3;
+
+CREATE TABLE table_stations ( mexs_id VARCHAR(8), icao VARCHAR(4), country CHAR(2), PRIMARY KEY (mexs_id), UNIQUE KEY icao (icao), KEY country (country), CONSTRAINT stations_ibfk_8 FOREIGN KEY (country) REFERENCES countries (country) ON UPDATE CASCADE);
+INSERT INTO table_stations VALUES ('87654321','XXXX','YY');
+
+CREATE TABLE table_countries ( country CHAR(2), iso_short_en VARCHAR(64), PRIMARY KEY (country));
+INSERT INTO table_countries VALUES ('YY','Entenhausen');
+
+CREATE ALGORITHM=MERGE SQL SECURITY INVOKER VIEW view_stations AS select table_stations.mexs_id AS mexs_id, table_stations.icao AS icao, table_stations.country AS landescode from (table_stations join table_countries on((table_stations.country = table_countries.country)));
+
+CREATE TABLE table_source ( id varchar(4), datetime TIMESTAMP, PRIMARY KEY (id));
+INSERT INTO table_source VALUES ('XXXX','2006-07-12 07:50:00');
+
+GRANT SELECT ON table_source TO user20989@localhost;
+GRANT SELECT ON table_countries TO user20989@localhost;
+GRANT SELECT ON table_stations TO user20989@localhost;
+GRANT SELECT ON view_stations TO user20989@localhost;
+GRANT SELECT ON table_target TO user20989@localhost;
+GRANT SELECT ON table_target2 TO user20989@localhost;
+GRANT INSERT,DELETE,SELECT ON view_target3 TO user20989@localhost;
+
+connect (user20989,localhost,user20989,,meow);
+connection user20989;
+
+--error 1142
+REPLACE INTO table_target
+SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
+FROM table_source
+INNER JOIN view_stations AS stations
+ON table_source.id = stations.icao
+LEFT JOIN table_target AS old
+USING (mexs_id);
+
+--error 1142
+REPLACE INTO view_target2
+SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
+FROM table_source
+INNER JOIN view_stations AS stations
+ON table_source.id = stations.icao
+LEFT JOIN view_target2 AS old
+USING (mexs_id);
+
+--error 1356
+REPLACE INTO view_target3
+SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
+FROM table_source
+INNER JOIN view_stations AS stations
+ON table_source.id = stations.icao
+LEFT JOIN view_target3 AS old
+USING (mexs_id);
+
+connection root;
+disconnect user20989;
+
+GRANT INSERT,DELETE ON table_target TO user20989@localhost;
+GRANT INSERT,DELETE,SELECT ON view_target2 TO user20989@localhost;
+GRANT INSERT,DELETE,SELECT ON table_target3 TO user20989@localhost;
+
+connect (user20989,localhost,user20989,,meow);
+connection user20989;
+
+REPLACE INTO table_target
+SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
+FROM table_source
+INNER JOIN view_stations AS stations
+ON table_source.id = stations.icao
+LEFT JOIN table_target AS old
+USING (mexs_id);
+
+--error 1142
+REPLACE INTO table_target2 VALUES ('00X45Y78','2006-07-12 07:50:00');
+REPLACE INTO view_target2 VALUES ('12X45Y78','2006-07-12 07:50:00');
+
+SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
+FROM table_source
+INNER JOIN view_stations AS stations
+ON table_source.id = stations.icao
+LEFT JOIN view_target2 AS old
+USING (mexs_id);
+
+REPLACE INTO view_target2
+SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
+FROM table_source
+INNER JOIN view_stations AS stations
+ON table_source.id = stations.icao
+LEFT JOIN view_target2 AS old
+USING (mexs_id);
+
+REPLACE INTO view_target3
+SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
+FROM table_source
+INNER JOIN view_stations AS stations
+ON table_source.id = stations.icao
+LEFT JOIN view_target3 AS old
+USING (mexs_id);
+
+connection root;
+disconnect user20989;
+
+SELECT * FROM table_target;
+SELECT * FROM view_target2;
+SELECT * FROM view_target3;
+
+DROP VIEW view_stations;
+DROP TABLE table_source;
+DROP TABLE table_countries;
+DROP TABLE table_stations;
+DROP TABLE table_target;
+DROP TABLE table_target2;
+DROP TABLE table_target3;
+DROP VIEW view_target2;
+DROP VIEW view_target3;
+DROP USER user20989@localhost;
+
+disconnect root;
+
+connection default;
+
+DROP DATABASE meow;
diff --git a/mysql-test/t/insert_select.test b/mysql-test/t/insert_select.test
index 6f86ed897ac..404d67390ab 100644
--- a/mysql-test/t/insert_select.test
+++ b/mysql-test/t/insert_select.test
@@ -266,140 +266,3 @@ INSERT INTO bug21774_2.t1 SELECT t1.* FROM t1;
DROP DATABASE bug21774_1;
DROP DATABASE bug21774_2;
-#
-# Bug #20989: View '(null).(null)' references invalid table(s)... on
-# SQL SECURITY INVOKER
-#
-# this is really the fact that REPLACE ... SELECT required additional
-# INSERT privs (on tables that are part of a view) over the related
-# REPLACE, SELECT
-#
-
-CREATE DATABASE meow;
-
-connect (root,localhost,root,,meow);
-connection root;
-
-CREATE TABLE table_target ( mexs_id CHAR(8), messzeit TIMESTAMP, PRIMARY KEY (mexs_id));
-CREATE TABLE table_target2 ( mexs_id CHAR(8), messzeit TIMESTAMP, PRIMARY KEY (mexs_id));
-CREATE TABLE table_target3 ( mexs_id CHAR(8), messzeit TIMESTAMP, PRIMARY KEY (mexs_id));
-CREATE VIEW view_target2 AS SELECT mexs_id,messzeit FROM table_target2;
-CREATE SQL SECURITY INVOKER VIEW view_target3 AS SELECT mexs_id,messzeit FROM table_target3;
-
-CREATE TABLE table_stations ( mexs_id VARCHAR(8), icao VARCHAR(4), country CHAR(2), PRIMARY KEY (mexs_id), UNIQUE KEY icao (icao), KEY country (country), CONSTRAINT stations_ibfk_8 FOREIGN KEY (country) REFERENCES countries (country) ON UPDATE CASCADE);
-INSERT INTO table_stations VALUES ('87654321','XXXX','YY');
-
-CREATE TABLE table_countries ( country CHAR(2), iso_short_en VARCHAR(64), PRIMARY KEY (country));
-INSERT INTO table_countries VALUES ('YY','Entenhausen');
-
-CREATE ALGORITHM=MERGE SQL SECURITY INVOKER VIEW view_stations AS select table_stations.mexs_id AS mexs_id, table_stations.icao AS icao, table_stations.country AS landescode from (table_stations join table_countries on((table_stations.country = table_countries.country)));
-
-CREATE TABLE table_source ( id varchar(4), datetime TIMESTAMP, PRIMARY KEY (id));
-INSERT INTO table_source VALUES ('XXXX','2006-07-12 07:50:00');
-
-GRANT SELECT ON table_source TO user20989@localhost;
-GRANT SELECT ON table_countries TO user20989@localhost;
-GRANT SELECT ON table_stations TO user20989@localhost;
-GRANT SELECT ON view_stations TO user20989@localhost;
-GRANT SELECT ON table_target TO user20989@localhost;
-GRANT SELECT ON table_target2 TO user20989@localhost;
-GRANT INSERT,DELETE,SELECT ON view_target3 TO user20989@localhost;
-
-connect (user20989,localhost,user20989,,meow);
-connection user20989;
-
---error 1142
-REPLACE INTO table_target
-SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
-FROM table_source
-INNER JOIN view_stations AS stations
-ON table_source.id = stations.icao
-LEFT JOIN table_target AS old
-USING (mexs_id);
-
---error 1142
-REPLACE INTO view_target2
-SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
-FROM table_source
-INNER JOIN view_stations AS stations
-ON table_source.id = stations.icao
-LEFT JOIN view_target2 AS old
-USING (mexs_id);
-
---error 1356
-REPLACE INTO view_target3
-SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
-FROM table_source
-INNER JOIN view_stations AS stations
-ON table_source.id = stations.icao
-LEFT JOIN view_target3 AS old
-USING (mexs_id);
-
-connection root;
-disconnect user20989;
-
-GRANT INSERT,DELETE ON table_target TO user20989@localhost;
-GRANT INSERT,DELETE,SELECT ON view_target2 TO user20989@localhost;
-GRANT INSERT,DELETE,SELECT ON table_target3 TO user20989@localhost;
-
-connect (user20989,localhost,user20989,,meow);
-connection user20989;
-
-REPLACE INTO table_target
-SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
-FROM table_source
-INNER JOIN view_stations AS stations
-ON table_source.id = stations.icao
-LEFT JOIN table_target AS old
-USING (mexs_id);
-
---error 1142
-REPLACE INTO table_target2 VALUES ('00X45Y78','2006-07-12 07:50:00');
-REPLACE INTO view_target2 VALUES ('12X45Y78','2006-07-12 07:50:00');
-
-SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
-FROM table_source
-INNER JOIN view_stations AS stations
-ON table_source.id = stations.icao
-LEFT JOIN view_target2 AS old
-USING (mexs_id);
-
-REPLACE INTO view_target2
-SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
-FROM table_source
-INNER JOIN view_stations AS stations
-ON table_source.id = stations.icao
-LEFT JOIN view_target2 AS old
-USING (mexs_id);
-
-REPLACE INTO view_target3
-SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
-FROM table_source
-INNER JOIN view_stations AS stations
-ON table_source.id = stations.icao
-LEFT JOIN view_target3 AS old
-USING (mexs_id);
-
-connection root;
-disconnect user20989;
-
-SELECT * FROM table_target;
-SELECT * FROM view_target2;
-SELECT * FROM view_target3;
-
-DROP VIEW view_stations;
-DROP TABLE table_source;
-DROP TABLE table_countries;
-DROP TABLE table_stations;
-DROP TABLE table_target;
-DROP TABLE table_target2;
-DROP TABLE table_target3;
-DROP VIEW view_target2;
-DROP VIEW view_target3;
-DROP USER user20989@localhost;
-
-disconnect root;
-
-connection default;
-
-DROP DATABASE meow;
diff --git a/mysql-test/t/join.test b/mysql-test/t/join.test
index f39938ec52c..e277981e626 100644
--- a/mysql-test/t/join.test
+++ b/mysql-test/t/join.test
@@ -520,6 +520,7 @@ select * from v1a join v1b on t1.b = t2.b;
#
# Bug #17523 natural join and information_schema
#
+# We mask out the Privileges column because it differs with embedded server
--replace_column 31 #
select * from information_schema.statistics join information_schema.columns
using(table_name,column_name) where table_name='user';
diff --git a/mysql-test/t/lock_multi.test b/mysql-test/t/lock_multi.test
index 6c89a8b4a7b..2b92ddf76ec 100644
--- a/mysql-test/t/lock_multi.test
+++ b/mysql-test/t/lock_multi.test
@@ -1,3 +1,4 @@
+-- source include/not_embedded.inc
--disable_warnings
drop table if exists t1,t2;
--enable_warnings
diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test
index 15b0a476279..f38af9644c9 100644
--- a/mysql-test/t/ps.test
+++ b/mysql-test/t/ps.test
@@ -1,3 +1,4 @@
+-- source include/not_embedded.inc
#
# SQL Syntax for Prepared Statements test
#
diff --git a/mysql-test/t/ps_1general.test b/mysql-test/t/ps_1general.test
index 4c0f411c758..dd70f7edfa7 100644
--- a/mysql-test/t/ps_1general.test
+++ b/mysql-test/t/ps_1general.test
@@ -579,7 +579,7 @@ prepare stmt1 from ' rename table t5 to t6, t7 to t8 ' ;
create table t5 (a int) ;
# rename must fail, t7 does not exist
# Clean up the filename here because embedded server reports whole path
---replace_result \\ / $MYSQL_TEST_DIR . /var/master-data/ / t7.frm t7
+--replace_result \\ / $MYSQL_TEST_DIR . /var/master-data/ "" t7.frm t7
--error 1017
execute stmt1 ;
create table t7 (a int) ;
diff --git a/mysql-test/t/status.test b/mysql-test/t/status.test
index 099c2e062bb..746d3a352a4 100644
--- a/mysql-test/t/status.test
+++ b/mysql-test/t/status.test
@@ -1,3 +1,6 @@
+# embedded server causes different stat
+-- source include/not_embedded.inc
+
# PS causes different statistics
--disable_ps_protocol
diff --git a/mysql-test/t/trigger.test b/mysql-test/t/trigger.test
index 12262894e5b..916a85ec424 100644
--- a/mysql-test/t/trigger.test
+++ b/mysql-test/t/trigger.test
@@ -1140,6 +1140,7 @@ select trigger_schema, trigger_name, event_object_schema,
# Trick which makes update of second .TRN file impossible
system echo dummy >$MYSQLTEST_VARDIR/master-data/test/t1_ai.TRN~;
system chmod 000 $MYSQLTEST_VARDIR/master-data/test/t1_ai.TRN~;
+--replace_result $MYSQLTEST_VARDIR . master-data// ''
--error 1
rename table t1 to t2;
# 't1' should be still there and triggers should work correctly
diff --git a/sql/item_func.cc b/sql/item_func.cc
index 91c8a1ffdff..4cbe76a49f8 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -3402,7 +3402,11 @@ longlong Item_func_release_lock::val_int()
}
else
{
+#ifdef EMBEDDED_LIBRARY
+ if (ull->locked && pthread_equal(current_thd->real_id,ull->thread))
+#else
if (ull->locked && pthread_equal(pthread_self(),ull->thread))
+#endif
{
result=1; // Release is ok
item_user_lock_release(ull);
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index 3faee2ec9a1..89a85a19f56 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -1811,8 +1811,13 @@ bool Item_func_current_user::fix_fields(THD *thd, Item **ref)
if (Item_func_sysconst::fix_fields(thd, ref))
return TRUE;
- Security_context *ctx= (context->security_ctx
+ Security_context *ctx=
+#ifndef NO_EMBEDDED_ACCESS_CHECKS
+ (context->security_ctx
? context->security_ctx : thd->security_ctx);
+#else
+ thd->security_ctx;
+#endif /*NO_EMBEDDED_ACCESS_CHECKS*/
return init(ctx->priv_user, ctx->priv_host);
}
diff --git a/sql/share/errmsg.txt b/sql/share/errmsg.txt
index 1b9e1aa96ec..671dbbd9c03 100644
--- a/sql/share/errmsg.txt
+++ b/sql/share/errmsg.txt
@@ -78,7 +78,7 @@ ER_CANT_CREATE_TABLE
cze "Nemohu vytvo-Bit tabulku '%-.64s' (chybov kd: %d)"
dan "Kan ikke oprette tabellen '%-.64s' (Fejlkode: %d)"
nla "Kan tabel '%-.64s' niet aanmaken (Errcode: %d)"
- eng "Can't create table '%-.64s' (errno: %d)"
+ eng "Can't create table '%-.200s' (errno: %d)"
jps "'%-.64s' e[u܂.(errno: %d)",
est "Ei suuda luua tabelit '%-.64s' (veakood: %d)"
fre "Ne peut crer la table '%-.64s' (Errcode: %d)"
@@ -574,7 +574,7 @@ ER_ERROR_ON_RENAME
cze "Chyba p-Bi pejmenovn '%-.64s' na '%-.64s' (chybov kd: %d)"
dan "Fejl ved omdbning af '%-.64s' til '%-.64s' (Fejlkode: %d)"
nla "Fout bij het hernoemen van '%-.64s' naar '%-.64s' (Errcode: %d)"
- eng "Error on rename of '%-.64s' to '%-.64s' (errno: %d)"
+ eng "Error on rename of '%-.150s' to '%-.150s' (errno: %d)"
jps "'%-.64s' '%-.64s' rename ł܂ (errno: %d)",
est "Viga faili '%-.64s' mbernimetamisel '%-.64s'-ks (veakood: %d)"
fre "Erreur en renommant '%-.64s' en '%-.64s' (Errcode: %d)"
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index 382b91dddac..ccacd71a614 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -2924,7 +2924,9 @@ static TABLE *create_table_from_items(THD *thd, HA_CREATE_INFO *create_info,
save us from that ?
*/
table->reginfo.lock_type=TL_WRITE;
+#ifdef HAVE_ROW_BASED_REPLICATION
hooks->prelock(&table, 1); // Call prelock hooks
+#endif
if (! ((*lock)= mysql_lock_tables(thd, &table, 1,
MYSQL_LOCK_IGNORE_FLUSH, &not_used)))
{
diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc
index 2700f9cbd9e..397856a4a4e 100644
--- a/storage/myisam/ha_myisam.cc
+++ b/storage/myisam/ha_myisam.cc
@@ -1369,10 +1369,12 @@ int ha_myisam::info(uint flag)
if table is symlinked (Ie; Real name is not same as generated name)
*/
data_file_name= index_file_name= 0;
- fn_format(name_buff, file->filename, "", MI_NAME_DEXT, MY_APPEND_EXT);
+ fn_format(name_buff, file->filename, "", MI_NAME_DEXT,
+ MY_APPEND_EXT | MY_UNPACK_FILENAME);
if (strcmp(name_buff, info.data_file_name))
data_file_name=info.data_file_name;
- fn_format(name_buff, file->filename, "", MI_NAME_IEXT, MY_APPEND_EXT);
+ fn_format(name_buff, file->filename, "", MI_NAME_IEXT,
+ MY_APPEND_EXT | MY_UNPACK_FILENAME);
if (strcmp(name_buff, info.index_file_name))
index_file_name=info.index_file_name;
}