Commit 333b2684 authored by unknown's avatar unknown

WL#3630 (add embedded server to pushbuild)

5.1-related fixes
libmysqld/Makefile.am fixed to recompile and link ha_*.cc files that
keep dependance on THD structure.
Minor fixes to make tests working.


config/ac-macros/plugins.m4:
  condition_dependent_plugin_objects added
libmysqld/Makefile.am:
  rules for ha_*.o files added
  condition_dependent_plugin_objects sent to linker
libmysqld/lib_sql.cc:
  ddl_log initialization added
mysql-test/r/flush_block_commit_notembedded.result:
  result fixed
mysql-test/t/crash_commit_before.test:
  doesn't work in embedded server
mysql-test/t/csv.test:
  replace_result added
mysql-test/t/ps.test:
  doesn't work in embedded server
  should be fixed by separating ps_notembedded.test
mysql-test/t/ps_1general.test:
  replace_result fixed
mysql-test/t/ps_not_windows.test:
  doesn't work in embedded server
mysql-test/t/trigger.test:
  replace_result fixed
sql/sql_insert.cc:
  #ifdef HAVE_ROW_BASED_REPLICATION added
storage/myisam/ha_myisam.cc:
  MY_UNPACK_FILENAME flag added
parent 1aa1efdb
......@@ -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, [^.+[/$]], [\&])"
])
......
......@@ -79,6 +79,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
......@@ -109,6 +110,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
......@@ -120,18 +139,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 \
......@@ -142,6 +161,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
......
......@@ -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);
}
......
......@@ -5,11 +5,11 @@ insert t1 values (1);
flush tables with read lock;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 98
commit;
master-bin.000001 102
commit;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 98
master-bin.000001 102
unlock tables;
drop table t1;
set autocommit=1;
-- source include/not_embedded.inc
# Don't test this under valgrind, memory leaks will occur
--source include/not_valgrind.inc
......
......@@ -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;
......
-- source include/not_embedded.inc
#
# SQL Syntax for Prepared Statements 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) ;
......
-- source include/not_embedded.inc
# Non-windows specific ps tests.
--source include/not_windows.inc
......
......@@ -1140,7 +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/ ''
--replace_result $MYSQLTEST_VARDIR . master-data// ''
--error 1
rename table t1 to t2;
# 't1' should be still there and triggers should work correctly
......
......@@ -2928,7 +2928,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)))
{
......
......@@ -1370,10 +1370,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;
}
......
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