diff options
| -rw-r--r-- | configure.ac | 40 | ||||
| -rw-r--r-- | src/mysql_inc.h | 3 | ||||
| -rw-r--r-- | src/table_sizes.cc | 14 |
3 files changed, 39 insertions, 18 deletions
diff --git a/configure.ac b/configure.ac index 7e6764d..86fda3a 100644 --- a/configure.ac +++ b/configure.ac | |||
| @@ -11,26 +11,42 @@ AC_CONFIG_SRCDIR([src/table_sizes.cc]) | |||
| 11 | AC_CONFIG_HEADER([src/config.h]) | 11 | AC_CONFIG_HEADER([src/config.h]) |
| 12 | 12 | ||
| 13 | AC_DEFUN([CHECK_DEBUG], [ | 13 | AC_DEFUN([CHECK_DEBUG], [ |
| 14 | debug_default="no" | 14 | AC_ARG_ENABLE([debug], |
| 15 | AC_ARG_ENABLE(debug, [ --enable-debug=[no/yes] turn on debugging | 15 | AS_HELP_STRING([--enable-debug], [turn on debugging, default: no])) |
| 16 | [default=no]],, enable_debug=$debug_default) | 16 | |
| 17 | AC_MSG_CHECKING(whether to enable debugging) | 17 | AC_MSG_CHECKING(whether to enable debugging) |
| 18 | AS_IF([test "x$enable_debug" = "xyes"], | ||
| 19 | [ | ||
| 20 | CPPFLAGS="$CPPFLAGS -g -D_DEBUG" | ||
| 21 | AC_MSG_RESULT(yes) | ||
| 22 | ], | ||
| 23 | [ | ||
| 24 | CPPFLAGS="$CPPFLAGS -g -O2 -DDBUG_OFF" | ||
| 25 | AC_MSG_RESULT(no) | ||
| 26 | ] | ||
| 27 | ) | ||
| 28 | ]) | ||
| 18 | 29 | ||
| 19 | if test "x$enable_debug" = "xyes" | 30 | AC_DEFUN([CHECK_FAST_MUTEXES], [ |
| 20 | then | 31 | AC_ARG_ENABLE([fast-mutexes], |
| 21 | CPPFLAGS="$CPPFLAGS -g -D_DEBUG" | 32 | AS_HELP_STRING([--enable-fast-mutexes], [compile with fast mutexes, default: no])) |
| 22 | AC_MSG_RESULT(yes) | 33 | |
| 23 | else | 34 | AC_MSG_CHECKING(whether to compile with fast mutexes) |
| 24 | CPPFLAGS="$CPPFLAGS -g -O2 -DDBUG_OFF" | 35 | AS_IF([test "x$enable_fast_mutexes" = "xyes"], |
| 25 | AC_MSG_RESULT(no) | 36 | [ |
| 26 | fi | 37 | CPPFLAGS="$CPPFLAGS -DMY_PTHREAD_FASTMUTEX=1" |
| 38 | AC_MSG_RESULT(yes) | ||
| 39 | ], | ||
| 40 | [ AC_MSG_RESULT(no) ] | ||
| 41 | ) | ||
| 27 | ]) | 42 | ]) |
| 28 | 43 | ||
| 44 | |||
| 29 | dnl Run tests using C++ compiler | 45 | dnl Run tests using C++ compiler |
| 30 | dnl AC_LANG(C++) | 46 | dnl AC_LANG(C++) |
| 31 | 47 | ||
| 32 | #check debug | ||
| 33 | CHECK_DEBUG | 48 | CHECK_DEBUG |
| 49 | CHECK_FAST_MUTEXES | ||
| 34 | 50 | ||
| 35 | #check for mysql src | 51 | #check for mysql src |
| 36 | MYSQL_SRC_TEST | 52 | MYSQL_SRC_TEST |
diff --git a/src/mysql_inc.h b/src/mysql_inc.h index ca055ca..4912682 100644 --- a/src/mysql_inc.h +++ b/src/mysql_inc.h | |||
| @@ -5,7 +5,10 @@ | |||
| 5 | #define HAVE_CONFIG_H | 5 | #define HAVE_CONFIG_H |
| 6 | #endif | 6 | #endif |
| 7 | 7 | ||
| 8 | #ifndef MYSQL_DYNAMIC_PLUGIN | ||
| 8 | #define MYSQL_DYNAMIC_PLUGIN | 9 | #define MYSQL_DYNAMIC_PLUGIN |
| 10 | #endif | ||
| 11 | |||
| 9 | #define MYSQL_SERVER 1 | 12 | #define MYSQL_SERVER 1 |
| 10 | 13 | ||
| 11 | #include <mysql_version.h> | 14 | #include <mysql_version.h> |
diff --git a/src/table_sizes.cc b/src/table_sizes.cc index b1fd8b0..bfa0106 100644 --- a/src/table_sizes.cc +++ b/src/table_sizes.cc | |||
| @@ -13,10 +13,10 @@ | |||
| 13 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | 13 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 14 | */ | 14 | */ |
| 15 | #include "mysql_inc.h" | 15 | #include "mysql_inc.h" |
| 16 | #include <sql/sql_show.h> | 16 | #include <sql_show.h> |
| 17 | #include <sql/sql_table.h> | 17 | #include <sql_table.h> |
| 18 | #include <sql/sql_parse.h> | 18 | #include <sql_parse.h> |
| 19 | #include <sql/sql_db.h> | 19 | #include <sql_db.h> |
| 20 | 20 | ||
| 21 | #define STR_OR_NIL(S) ((S) ? (S) : "<nil>") | 21 | #define STR_OR_NIL(S) ((S) ? (S) : "<nil>") |
| 22 | 22 | ||
| @@ -292,13 +292,15 @@ static int fill_table(THD *thd, TABLE_LIST *tables, COND *cond) | |||
| 292 | goto err; | 292 | goto err; |
| 293 | 293 | ||
| 294 | LEX_STRING *db_name; | 294 | LEX_STRING *db_name; |
| 295 | while (db_name = it++) | 295 | while ((db_name = it++)) |
| 296 | { | 296 | { |
| 297 | #ifndef NO_EMBEDDED_ACCESS_CHECKS | ||
| 297 | if ((check_access(thd, SELECT_ACL, db_name->str, &thd->col_access, NULL, 0, 1) | 298 | if ((check_access(thd, SELECT_ACL, db_name->str, &thd->col_access, NULL, 0, 1) |
| 298 | || (!thd->col_access && check_grant_db(thd, db_name->str))) | 299 | || (!thd->col_access && check_grant_db(thd, db_name->str))) |
| 299 | && !sctx->master_access & (DB_ACLS | SHOW_DB_ACL) | 300 | && !sctx->master_access & (DB_ACLS | SHOW_DB_ACL) |
| 300 | && !acl_get(sctx->host, sctx->ip, sctx->priv_user, db_name->str, 0)) | 301 | && !acl_get(sctx->host, sctx->ip, sctx->priv_user, db_name->str, 0)) |
| 301 | continue; | 302 | continue; |
| 303 | #endif | ||
| 302 | 304 | ||
| 303 | List<TABLE_DATA> tables; | 305 | List<TABLE_DATA> tables; |
| 304 | int res = make_table_list(thd, &tables, lex, db_name); | 306 | int res = make_table_list(thd, &tables, lex, db_name); |
| @@ -312,7 +314,7 @@ static int fill_table(THD *thd, TABLE_LIST *tables, COND *cond) | |||
| 312 | 314 | ||
| 313 | TABLE_DATA *table_data; | 315 | TABLE_DATA *table_data; |
| 314 | List_iterator_fast<TABLE_DATA> it_tables(tables); | 316 | List_iterator_fast<TABLE_DATA> it_tables(tables); |
| 315 | while (table_data = it_tables++) | 317 | while ((table_data = it_tables++)) |
| 316 | { | 318 | { |
| 317 | table->field[0]->store(db_name->str, db_name->length, | 319 | table->field[0]->store(db_name->str, db_name->length, |
| 318 | system_charset_info); | 320 | system_charset_info); |
