Commit 6135a547 authored by unknown's avatar unknown

Merge fix for PBXT running inside embedded server (MBug#439889).

Also some small fixes to make the PBXT testsuite work in --embedded.

config/ac-macros/plugins.m4:
  MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS macro extended to support multiple files.
mysql-test/std_data/pbxt_load_unique_error1.inc:
  Move file to be accessible also for testing embedded server.
mysql-test/suite/pbxt/r/pbxt_bugs.result:
  Fix LOAD DATA LOCAL INFILE path so it works also for testing embedded server.
mysql-test/suite/pbxt/t/pbxt_bugs.test:
  Fix LOAD DATA LOCAL INFILE path so it works also for testing embedded server.
mysql-test/suite/pbxt/t/pbxt_locking.test:
  Disable for embedded, as it needs SHOW PROCESSLIST functionality not available there.
mysql-test/suite/pbxt/t/pbxt_transactions.test:
  Disable test for embedded, as it needs ability to connect from outside (mysqldump).
mysql-test/suite/pbxt/t/ps_1general.test:
  Fix replace_result for new mysql-test-run.pl.
sql/sql_plugin.cc:
  Remove hack that disables PBXT in embedded.
storage/pbxt/plug.in:
  Fix crash in PBXT in embedded server.
storage/pbxt/src/Makefile.am:
  Remove not needed CFLAGS/CXXFLAGS (they cause autotools to generate different object names, which in turn cause the MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS replacement of object files inside library files not to work).
storage/pbxt/src/ha_pbxt.cc:
  Ugly hack to allow more threads in embedded server (need a better fix I think).
storage/pbxt/src/table_xt.cc:
  Use stderr for logging not stdout (prevent spamming --embedded test suite output with stray messages).
storage/pbxt/src/thread_xt.cc:
  Use stderr for logging not stdout (prevent spamming --embedded test suite output with stray messages).
storage/pbxt/src/trace_xt.cc:
  Use stderr for logging not stdout (prevent spamming --embedded test suite output with stray messages).
parents 342f047b 8bc8de1a
......@@ -267,7 +267,6 @@ dnl we have to recompile these modules when we want to
dnl to compile server parts with the different #defines
dnl Normally it happens when we compile the embedded server
dnl Thus one should mark such files in his handler using this macro
dnl (currently only one such a file per plugin is supported)
dnl
dnl ---------------------------------------------------------------------------
......@@ -463,11 +462,13 @@ dnl Although this is "pretty", it breaks libmysqld build
mysql_plugin_defs="$mysql_plugin_defs, [builtin_]$2[_plugin]"
[with_plugin_]$2=yes
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, [^.+[/$]], [\&])"
m4_ifdef([$11], [
m4_foreach([plugin], [$11], [
condition_dependent_plugin_modules="$condition_dependent_plugin_modules m4_bregexp(plugin, [[^/]+$], [\&])"
condition_dependent_plugin_objects="$condition_dependent_plugin_objects m4_bregexp(plugin, [[^/]+\.], [\&o])"
condition_dependent_plugin_links="$condition_dependent_plugin_links $6/plugin"
condition_dependent_plugin_includes="$condition_dependent_plugin_includes -I[\$(top_srcdir)]/$6/m4_bregexp(plugin, [^.+[/$]], [\&])"
])
])
fi
fi
......
......@@ -1212,7 +1212,7 @@ c1
2147483647
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (c1 INTEGER NOT NULL PRIMARY KEY, c2 VARCHAR(255));
LOAD DATA LOCAL INFILE 'suite/pbxt/t/load_unique_error1.inc' REPLACE INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' (@c1,c2) SET c1 = @c1 % 2;
LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/std_data/pbxt_load_unique_error1.inc' REPLACE INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' (@c1,c2) SET c1 = @c1 % 2;
SELECT * FROM t1 ORDER BY c1;
c1 c2
0 opq
......
......@@ -921,7 +921,8 @@ SELECT c1 FROM t2;
DROP TABLE IF EXISTS t1;
--enable_warnings
CREATE TABLE t1 (c1 INTEGER NOT NULL PRIMARY KEY, c2 VARCHAR(255));
LOAD DATA LOCAL INFILE 'suite/pbxt/t/load_unique_error1.inc' REPLACE INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' (@c1,c2) SET c1 = @c1 % 2;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval LOAD DATA LOCAL INFILE '$MYSQLTEST_VARDIR/std_data/pbxt_load_unique_error1.inc' REPLACE INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' (@c1,c2) SET c1 = @c1 % 2;
--sorted_result
SELECT * FROM t1 ORDER BY c1;
DROP TABLE t1;
......
# This test covers various aspects of PBXT locking mechanism, including
# internal permanent/temporary row locking and MySQL locking
# SHOW PROCESSLIST has hardcoded "Writing to net" as state.
-- source include/not_embedded.inc
# TEST: select for update test
drop table if exists t1;
......
# We cannot run mysqldump against embedded server.
-- source include/not_embedded.inc
--disable_warnings
drop table if exists t1, t2, t3;
--enable_warnings
......
......@@ -582,7 +582,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 $MYSQLTEST_VARDIR . master-data/ '' t7.frm t7
--replace_result $MYSQLTEST_VARDIR . mysqld.1/data/ '' t7.frm t7
--error 1017
execute stmt1 ;
create table t7 (a int) ;
......
......@@ -1168,22 +1168,7 @@ int plugin_init(int *argc, char **argv, int flags)
!my_strnncoll(&my_charset_latin1, (const uchar*) plugin->name,
6, (const uchar*) "InnoDB", 6))
continue;
#ifdef EMBEDDED_LIBRARY
/*
MariaDB: disable PBXT in embedded server. We do this for two reasons
- PBXT currently doesn't work in embedded server (see
https://bugs.launchpad.net/maria/+bug/439889)
- Embedded server is supposed to be "leaner" and our current
understanding of that is "without PBXT". At the same time, we want
regular server to be with PBXT, and since we don't support compiling
embedded server with different options than the regular server,
the only way was to disable PBXT from here.
*/
if (!my_strnncoll(&my_charset_latin1, (const uchar*) plugin->name,
4, (const uchar*) "PBXT", 4))
continue;
#endif
bzero(&tmp, sizeof(tmp));
tmp.plugin= plugin;
tmp.name.str= (char *)plugin->name;
......
......@@ -5,3 +5,4 @@ MYSQL_PLUGIN_STATIC(pbxt, [src/libpbxt.a])
MYSQL_PLUGIN_ACTIONS(pbxt, [
# AC_CONFIG_FILES(storage/pbxt/src/Makefile)
])
MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS(pbxt, [[src/ha_pbxt.cc],[src/myxt_xt.cc],[src/discover_xt.cc]])
......@@ -46,7 +46,5 @@ libpbxt_la_CFLAGS = $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN -std=c99
EXTRA_LIBRARIES = libpbxt.a
noinst_LIBRARIES = libpbxt.a
libpbxt_a_SOURCES = $(libpbxt_la_SOURCES)
libpbxt_a_CXXFLAGS = $(AM_CXXFLAGS)
libpbxt_a_CFLAGS = $(AM_CFLAGS) -std=c99
EXTRA_DIST = pbms_enabled.cc win_inttypes.h
......@@ -1175,8 +1175,12 @@ static int pbxt_init(void *p)
* +1 Temporary thread (e.g. TempForClose, TempForEnd)
*/
#ifndef DRIZZLED
#ifdef EMBEDDED_LIBRARY
pbxt_max_threads = 100;
#else
if (pbxt_max_threads == 0)
pbxt_max_threads = max_connections + 7;
#endif
#endif
self = xt_init_threading(pbxt_max_threads); /* Create the main self: */
if (!self)
......
This diff is collapsed.
......@@ -96,7 +96,7 @@ xtPublic xtBool xt_init_logging(void)
{
int err;
log_file = stdout;
log_file = stderr;
log_level = XT_LOG_TRACE;
err = xt_p_mutex_init_with_autoname(&log_mutex, NULL);
if (err) {
......
......@@ -109,10 +109,10 @@ xtPublic void xt_print_trace(void)
xt_lock_mutex_ns(&trace_mutex);
if (trace_log_end > trace_log_offset+1) {
trace_log_buffer[trace_log_end] = 0;
printf("%s", trace_log_buffer + trace_log_offset + 1);
fprintf(stderr, "%s", trace_log_buffer + trace_log_offset + 1);
}
trace_log_buffer[trace_log_offset] = 0;
printf("%s", trace_log_buffer);
fprintf(stderr, "%s", trace_log_buffer);
trace_log_offset = 0;
trace_log_end = 0;
xt_unlock_mutex_ns(&trace_mutex);
......@@ -379,9 +379,9 @@ xtPublic void xt_dump_conn_tracking(void)
ptr = conn_info;
for (int i=0; i<XT_TRACK_MAX_CONNS; i++) {
if (ptr->ci_curr_xact_id || ptr->ci_prev_xact_id) {
printf("%3d curr=%d prev=%d prev-time=%ld\n", (int) ptr->cu_t_id, (int) ptr->ci_curr_xact_id, (int) ptr->ci_prev_xact_id, (long) ptr->ci_prev_xact_time);
fprintf(stderr, "%3d curr=%d prev=%d prev-time=%ld\n", (int) ptr->cu_t_id, (int) ptr->ci_curr_xact_id, (int) ptr->ci_prev_xact_id, (long) ptr->ci_prev_xact_time);
if (i+1<XT_TRACK_MAX_CONNS) {
printf(" diff=%d\n", (int) (ptr+1)->ci_curr_xact_id - (int) ptr->ci_curr_xact_id);
fprintf(stderr, " diff=%d\n", (int) (ptr+1)->ci_curr_xact_id - (int) ptr->ci_curr_xact_id);
}
}
ptr++;
......
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