summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/CMakeLists.txt39
-rw-r--r--scripts/comp_sql.c110
-rw-r--r--scripts/make_binary_distribution.sh6
-rwxr-xr-xscripts/make_win_bin_dist24
-rw-r--r--scripts/mysql_fix_privilege_tables.sh2
-rw-r--r--scripts/mysql_install_db.pl.in10
-rw-r--r--scripts/mysql_install_db.sh37
-rw-r--r--scripts/mysql_secure_installation.sh4
-rw-r--r--scripts/mysql_system_tables.sql6
-rw-r--r--scripts/mysql_system_tables_data.sql6
-rw-r--r--scripts/mysql_system_tables_fix.sql9
-rw-r--r--scripts/mysqld_multi.sh2
-rw-r--r--scripts/mysqld_safe.sh26
-rw-r--r--scripts/mysqldumpslow.sh54
14 files changed, 207 insertions, 128 deletions
diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt
index eee70fdf776..a62569843db 100755
--- a/scripts/CMakeLists.txt
+++ b/scripts/CMakeLists.txt
@@ -14,10 +14,12 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# Build mysql_fix_privilege_tables.sql
-ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_SOURCE_DIR}/scripts/mysql_fix_privilege_tables.sql
- COMMAND copy /b
- mysql_system_tables.sql + mysql_system_tables_fix.sql
- mysql_fix_privilege_tables.sql
+FILE(TO_NATIVE_PATH ${CMAKE_CURRENT_BINARY_DIR}/mysql_fix_privilege_tables.sql
+ native_outfile )
+ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_BINARY_DIR}/scripts/mysql_fix_privilege_tables.sql
+ COMMAND COMMAND ${CMAKE_COMMAND} -E chdir ${CMAKE_CURRENT_SOURCE_DIR}
+ cmd /c copy /b mysql_system_tables.sql + mysql_system_tables_fix.sql
+ ${native_outfile}
DEPENDS
${PROJECT_SOURCE_DIR}/scripts/mysql_system_tables.sql
${PROJECT_SOURCE_DIR}/scripts/mysql_system_tables_fix.sql)
@@ -29,24 +31,26 @@ TARGET_LINK_LIBRARIES(comp_sql debug dbug mysys strings)
# Use comp_sql to build mysql_fix_privilege_tables_sql.c
GET_TARGET_PROPERTY(COMP_SQL_EXE comp_sql LOCATION)
-ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_SOURCE_DIR}/scripts/mysql_fix_privilege_tables_sql.c
+ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_BINARY_DIR}/scripts/mysql_fix_privilege_tables_sql.c
COMMAND ${COMP_SQL_EXE}
mysql_fix_privilege_tables
- mysql_fix_privilege_tables.sql
+ ${CMAKE_CURRENT_BINARY_DIR}/mysql_fix_privilege_tables.sql
mysql_fix_privilege_tables_sql.c
- DEPENDS comp_sql ${PROJECT_SOURCE_DIR}/scripts/mysql_fix_privilege_tables.sql)
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ DEPENDS comp_sql
+ ${CMAKE_BINARY_DIR}/scripts/mysql_fix_privilege_tables.sql)
# Add dummy target for the above to be built
ADD_CUSTOM_TARGET(GenFixPrivs
ALL
- DEPENDS ${PROJECT_SOURCE_DIR}/scripts/mysql_fix_privilege_tables_sql.c)
+ DEPENDS ${CMAKE_BINARY_DIR}/scripts/mysql_fix_privilege_tables_sql.c)
# ----------------------------------------------------------------------
# Replace some variables @foo@ in the .in/.sh file, and write the new script
# ----------------------------------------------------------------------
SET(CFLAGS "-D_WINDOWS ${CMAKE_C_FLAGS_RELWITHDEBINFO}")
-SET(prefix "${CMAKE_INSTALL_PREFIX}/MySQL Server ${MYSQL_BASE_VERSION}")
+SET(prefix "${CMAKE_INSTALL_PREFIX}")
SET(sysconfdir ${prefix})
SET(bindir ${prefix}/bin)
SET(libexecdir ${prefix}/bin)
@@ -76,11 +80,14 @@ CONFIGURE_FILE(mysqldumpslow.sh
CONFIGURE_FILE(mysqlhotcopy.sh
${CMAKE_BINARY_DIR}/scripts/mysqlhotcopy.pl ESCAPE_QUOTES @ONLY)
-INSTALL(FILES mysqldumpslow.pl mysqlhotcopy.pl mysql_config.pl
+FOREACH(f mysqldumpslow.pl mysqlhotcopy.pl mysql_config.pl
mysql_convert_table_format.pl mysql_install_db.pl
- mysql_secure_installation.pl mysqld_multi.pl
- DESTINATION scripts COMPONENT scripts)
-
-INSTALL(FILES fill_help_tables.sql mysql_fix_privilege_tables.sql mysql_system_tables.sql
- mysql_system_tables_data.sql mysql_system_tables_fix.sql mysql_test_data_timezone.sql
- DESTINATION share COMPONENT scripts)
+ mysql_secure_installation.pl mysqld_multi.pl)
+ INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${f}
+ DESTINATION scripts COMPONENT Server_Scripts)
+ENDFOREACH()
+
+INSTALL(FILES fill_help_tables.sql mysql_system_tables.sql
+ mysql_system_tables_data.sql mysql_system_tables_fix.sql mysql_test_data_timezone.sql
+ DESTINATION share COMPONENT Server)
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/mysql_fix_privilege_tables.sql DESTINATION share COMPONENT Server) \ No newline at end of file
diff --git a/scripts/comp_sql.c b/scripts/comp_sql.c
index 88e88e632b6..e067d0757bf 100644
--- a/scripts/comp_sql.c
+++ b/scripts/comp_sql.c
@@ -25,6 +25,10 @@
#include <stdarg.h>
#include <stdlib.h>
#include <stdio.h>
+#include <sys/stat.h>
+
+/* Compiler-dependent constant for maximum string constant */
+#define MAX_STRING_CONSTANT_LENGTH 65535
FILE *in, *out;
@@ -58,64 +62,98 @@ static void die(const char *fmt, ...)
int main(int argc, char *argv[])
{
char buff[512];
+ struct stat st;
char* struct_name= argv[1];
char* infile_name= argv[2];
char* outfile_name= argv[3];
+
if (argc != 4)
die("Usage: comp_sql <struct_name> <sql_filename> <c_filename>");
/* Open input and output file */
if (!(in= fopen(infile_name, "r")))
die("Failed to open SQL file '%s'", infile_name);
+
+
if (!(out= fopen(outfile_name, "w")))
die("Failed to open output file '%s'", outfile_name);
+ fprintf(out, "const char %s[]={\n",struct_name);
+
+ /*
+ Some compilers have limitations how long a string constant can be.
+ We'll output very long strings as hexadecimal arrays, and short ones
+ as strings (prettier)
+ */
+ stat(infile_name, &st);
+ if (st.st_size > MAX_STRING_CONSTANT_LENGTH)
+ {
+ int cnt=0;
+ int c;
+ for(cnt=0;;cnt++)
+ {
+ c= fgetc(in);
+ if (c== -1)
+ break;
+
+ if(cnt != 0)
+ fputc(',', out);
- fprintf(out, "const char* %s={\n\"", struct_name);
+ /* Put line break after each 16 hex characters */
+ if(cnt && (cnt%16 == 0))
+ fputc('\n', out);
- while (fgets(buff, sizeof(buff), in))
+ fprintf(out,"0x%02x",c);
+ }
+ fprintf(out,",0x00");
+ }
+ else
{
- char *curr= buff;
- while (*curr)
+ fprintf(out,"\"");
+ while (fgets(buff, sizeof(buff), in))
{
- if (*curr == '\n')
- {
- /*
- Reached end of line, add escaped newline, escaped
- backslash and a newline to outfile
- */
- fprintf(out, "\\n \"\n\"");
- curr++;
- }
- else if (*curr == '\r')
- {
- curr++; /* Skip */
- }
- else
+ char *curr= buff;
+ while (*curr)
{
- if (*curr == '"')
+ if (*curr == '\n')
{
- /* Needs escape */
- fputc('\\', out);
+ /*
+ Reached end of line, add escaped newline, escaped
+ backslash and a newline to outfile
+ */
+ fprintf(out, "\\n \"\n\"");
+ curr++;
+ }
+ else if (*curr == '\r')
+ {
+ curr++; /* Skip */
+ }
+ else
+ {
+ if (*curr == '"')
+ {
+ /* Needs escape */
+ fputc('\\', out);
+ }
+
+ fputc(*curr, out);
+ curr++;
}
-
- fputc(*curr, out);
- curr++;
+ }
+ if (*(curr-1) != '\n')
+ {
+ /*
+ Some compilers have a max string length,
+ insert a newline at every 512th char in long
+ strings
+ */
+ fprintf(out, "\"\n\"");
}
}
- if (*(curr-1) != '\n')
- {
- /*
- Some compilers have a max string length,
- insert a newline at every 512th char in long
- strings
- */
- fprintf(out, "\"\n\"");
- }
+ fprintf(out, "\\\n\"");
}
-
- fprintf(out, "\\\n\"};\n");
-
+
+ fprintf(out, "};\n");
fclose(in);
fclose(out);
diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh
index c89c7cd875e..828670d9408 100644
--- a/scripts/make_binary_distribution.sh
+++ b/scripts/make_binary_distribution.sh
@@ -431,9 +431,9 @@ BIN_FILES="extra/comp_err$BS extra/replace$BS extra/perror$BS \
extra/resolve_stack_dump$BS extra/mysql_waitpid$BS \
storage/myisam/myisamchk$BS storage/myisam/myisampack$BS \
storage/myisam/myisamlog$BS storage/myisam/myisam_ftdump$BS \
- storage/maria/maria_chk$BS storage/maria/maria_pack$BS \
- storage/maria/maria_ftdump$BS storage/maria/maria_read_log$BS \
- storage/maria/maria_dump_log$BS \
+ storage/maria/aria_chk$BS storage/maria/aria_pack$BS \
+ storage/maria/aria_ftdump$BS storage/maria/aria_read_log$BS \
+ storage/maria/aria_dump_log$BS \
sql/mysqld$BS sql/mysqld-debug$BS \
sql/mysql_tzinfo_to_sql$BS \
server-tools/instance-manager/mysqlmanager$BS \
diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist
index 5c782af9f6f..35299f771cd 100755
--- a/scripts/make_win_bin_dist
+++ b/scripts/make_win_bin_dist
@@ -141,7 +141,7 @@ fi
# Copy executables, and client DLL
# ----------------------------------------------------------------------
MYISAM_BINARIES="myisamchk myisamlog myisampack myisam_ftdump"
-MARIA_BINARIES="maria_chk maria_dump_log maria_ftdump maria_pack maria_read_log"
+MARIA_BINARIES="aria_chk aria_dump_log aria_ftdump aria_pack aria_read_log"
mkdir $DESTDIR
mkdir $DESTDIR/bin
cp client/$TARGET/*.exe $DESTDIR/bin/
@@ -163,7 +163,7 @@ if [ -f "storage/pbxt/bin/xtstat.exe" ] ; then
cp storage/pbxt/bin/xtstat.{exe,pdb} $DESTDIR/bin
fi
-cp server-tools/instance-manager/$TARGET/*.exe $DESTDIR/bin/
+cp server-tools/instance-manager/$TARGET/*.exe $DESTDIR/bin/
if [ x"$TARGET" != x"release" ] ; then
cp server-tools/instance-manager/$TARGET/*.pdb $DESTDIR/bin/
cp client/$TARGET/mysql.pdb $DESTDIR/bin/
@@ -305,10 +305,7 @@ cp libmysql/$TARGET/libmysql.dll \
regex/$TARGET/regex.lib \
strings/$TARGET/strings.lib \
zlib/$TARGET/zlib.lib $DESTDIR/lib/opt/
-if [ -d storage/innodb_plugin ]; then
- cp storage/innodb_plugin/$TARGET/ha_innodb_plugin.dll \
- $DESTDIR/lib/plugin/
-fi
+cp storage/*/$TARGET/ha_*.dll $DESTDIR/lib/plugin/
if [ x"$TARGET" != x"release" ] ; then
cp libmysql/$TARGET/libmysql.pdb \
@@ -317,10 +314,7 @@ if [ x"$TARGET" != x"release" ] ; then
regex/$TARGET/regex.pdb \
strings/$TARGET/strings.pdb \
zlib/$TARGET/zlib.pdb $DESTDIR/lib/opt/
- if [ -d storage/innodb_plugin ]; then
- cp storage/innodb_plugin/$TARGET/ha_innodb_plugin.pdb \
- $DESTDIR/lib/plugin/
- fi
+ cp storage/*/$TARGET/ha_*.pdb $DESTDIR/lib/plugin/
fi
@@ -341,12 +335,10 @@ if [ x"$PACK_DEBUG" = x"" -a -f "libmysql/debug/libmysql.lib" -o \
strings/debug/strings.pdb \
zlib/debug/zlib.lib \
zlib/debug/zlib.pdb $DESTDIR/lib/debug/
- if [ -d storage/innodb_plugin ]; then
- cp storage/innodb_plugin/debug/ha_innodb_plugin.dll \
- storage/innodb_plugin/debug/ha_innodb_plugin.lib \
- storage/innodb_plugin/debug/ha_innodb_plugin.pdb \
- $DESTDIR/lib/plugin/debug/
- fi
+ cp storage/*/debug/ha_*.dll \
+ storage/*/debug/ha_*.lib \
+ storage/*/debug/ha_*.pdb \
+ $DESTDIR/lib/plugin/debug/
fi
# ----------------------------------------------------------------------
diff --git a/scripts/mysql_fix_privilege_tables.sh b/scripts/mysql_fix_privilege_tables.sh
index aaf0553151f..f0147b22878 100644
--- a/scripts/mysql_fix_privilege_tables.sh
+++ b/scripts/mysql_fix_privilege_tables.sh
@@ -103,7 +103,7 @@ do
fi
done
-parse_arguments `$print_defaults $defaults mysql_install_db mysql_fix_privilege_tables`
+parse_arguments `$print_defaults $defaults mysql_install_db client client-server client-mariadb mysql_fix_privilege_tables`
parse_arguments PICK-ARGS-FROM-ARGV "$@"
if test -z "$password"
diff --git a/scripts/mysql_install_db.pl.in b/scripts/mysql_install_db.pl.in
index c63da6df537..e20dc43867f 100644
--- a/scripts/mysql_install_db.pl.in
+++ b/scripts/mysql_install_db.pl.in
@@ -121,7 +121,7 @@ sub parse_arguments
"basedir=s",
"builddir=s", # FIXME not documented
"srcdir=s",
- "ldata|datadir=s",
+ "ldata|datadir|data=s",
# Note that the user will be passed to mysqld so that it runs
# as 'user' (crucial e.g. if log-bin=/some_other_path/
@@ -279,7 +279,7 @@ else
my @default_options;
my $cmd = quote_options($print_defaults,$opt->{'defaults-file'},
- "mysqld","mysql_install_db");
+ "mysqld","mariadb","mysql_install_db","server","client-server");
open(PIPE, "$cmd |") or error($opt,"can't run $cmd: $!");
while ( <PIPE> )
{
@@ -365,7 +365,7 @@ my $hostname = hostname();
my $resolved;
if ( !$opt->{'cross-bootstrap'} and !$opt->{rpm} and !$opt->{force} )
{
- my $resolveip;
+ my $resolveip = $bindir/resolveip;
$resolved = `$resolveip $hostname 2>&1`;
if ( $? != 0 )
@@ -423,9 +423,7 @@ my $mysqld_install_cmd_line = quote_options($mysqld_bootstrap,
"--bootstrap",
"--basedir=$opt->{basedir}",
"--datadir=$opt->{ldata}",
- "--skip-innodb",
- "--skip-bdb",
- "--skip-ndbcluster",
+ "--loose-skip-innodb",
"--max_allowed_packet=8M",
"--net_buffer_length=16K",
@args,
diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh
index 165faf34d9a..23eadd8312b 100644
--- a/scripts/mysql_install_db.sh
+++ b/scripts/mysql_install_db.sh
@@ -55,7 +55,8 @@ Usage: $0 [OPTIONS]
--help Display this help and exit.
--ldata=path The path to the MariaDB data directory. Same as
--datadir.
- --no-defaults Don't read default options from any option file.
+ --no-defaults Don't read any configuration files (my.cnf).
+ --defaults-file=path Read only this configuration file.
--rpm For internal use. This option is used by RPM files
during the MariaDB installation process.
--skip-name-resolve Use IP addresses rather than hostnames when creating
@@ -85,6 +86,13 @@ s_echo()
fi
}
+link_to_help()
+{
+ echo
+ echo "The latest information about mysql_install_db is available at"
+ echo "http://kb.askmonty.org/v/installing-system-tables-mysql_install_db."
+}
+
parse_arg()
{
echo "$1" | sed -e 's/^[^=]*=//'
@@ -109,7 +117,7 @@ parse_arguments()
--basedir=*) basedir=`parse_arg "$arg"` ;;
--builddir=*) builddir=`parse_arg "$arg"` ;;
--srcdir=*) srcdir=`parse_arg "$arg"` ;;
- --ldata=*|--datadir=*) ldata=`parse_arg "$arg"` ;;
+ --ldata=*|--datadir=*|--data=*) ldata=`parse_arg "$arg"` ;;
--user=*)
# Note that the user will be passed to mysqld so that it runs
# as 'user' (crucial e.g. if log-bin=/some_other_path/
@@ -200,7 +208,7 @@ cannot_find_file()
echo "If you are using a binary release, you must either be at the top"
echo "level of the extracted archive, or pass the --basedir option"
echo "pointing to that location."
- echo
+ link_to_help
}
# Ok, let's go. We first need to parse arguments which are required by
@@ -219,6 +227,7 @@ parse_arguments PICK-ARGS-FROM-ARGV "$@"
if test -n "$srcdir" && test -n "$basedir"
then
echo "ERROR: Specify either --basedir or --srcdir, not both."
+ link_to_help
exit 1
fi
if test -n "$srcdir"
@@ -248,7 +257,7 @@ fi
# Now we can get arguments from the groups [mysqld] and [mysql_install_db]
# in the my.cfg file, then re-run to merge with command line arguments.
-parse_arguments `"$print_defaults" $defaults mysqld mysql_install_db`
+parse_arguments `"$print_defaults" $defaults mysqld mariadb mysql_install_db client-server`
parse_arguments PICK-ARGS-FROM-ARGV "$@"
# Configure paths to support files
@@ -343,6 +352,7 @@ then
echo "hostname."
echo "If you want to solve this at a later stage, restart this script"
echo "with the --force option"
+ link_to_help
exit 1
fi
echo "WARNING: The host '$hostname' could not be looked up with resolveip."
@@ -364,7 +374,12 @@ for dir in "$ldata" "$ldata/mysql" "$ldata/test"
do
if test ! -d "$dir"
then
- mkdir -p "$dir"
+ if ! `mkdir -p "$dir"`
+ then
+ echo "Fatal error Can't create database directory '$dir'"
+ link_to_help
+ exit 1
+ fi
chmod 700 "$dir"
fi
if test -w / -a ! -z "$user"
@@ -394,14 +409,14 @@ mysqld_install_cmd_line()
{
"$mysqld_bootstrap" $defaults "$mysqld_opt" --bootstrap \
"--basedir=$basedir" "--datadir=$ldata" --log-warnings=0 --loose-skip-innodb \
- --loose-skip-ndbcluster $args --max_allowed_packet=8M \
+ --loose-skip-ndbcluster --loose-skip-pbxt $args --max_allowed_packet=8M \
--default-storage-engine=myisam \
--net_buffer_length=16K
}
# Create the system and help tables by passing them to "mysqld --bootstrap"
-s_echo "Installing MariaDB/MySQL system tables..."
+s_echo "Installing MariaDB/MySQL system tables in '$ldata' ..."
if { echo "use mysql;"; cat "$create_system_tables" "$fill_system_tables"; } | eval "$filter_cmd_line" | mysqld_install_cmd_line > /dev/null
then
s_echo "OK"
@@ -422,9 +437,7 @@ else
echo
echo "Try 'mysqld --help' if you have problems with paths. Using"
echo "--general-log gives you a log in $ldata that may be helpful."
- echo
- echo "The latest information about mysql_install_db is available at"
- echo "http://kb.askmonty.org/v/installing-system-tables-mysql_install_db."
+ link_to_help
echo "MariaDB is hosted on launchpad; You can find the latest source and"
echo "email lists at http://launchpad.net/maria"
echo
@@ -466,13 +479,13 @@ then
echo "databases and anonymous user created by default. This is"
echo "strongly recommended for production servers."
echo
- echo "See the MySQL manual for more instructions."
+ echo "See the MariaDB knowledge or the MySQL manual for more instructions."
if test "$in_rpm" -eq 0
then
echo
echo "You can start the MariaDB daemon with:"
- echo "cd '$basedir' ; '$bindir/mysqld_safe' &"
+ echo "cd '$basedir' ; $bindir/mysqld_safe --datadir='$ldata'"
echo
echo "You can test the MariaDB daemon with mysql-test-run.pl"
echo "cd '$basedir/mysql-test' ; perl mysql-test-run.pl"
diff --git a/scripts/mysql_secure_installation.sh b/scripts/mysql_secure_installation.sh
index 363bd5fba8f..9e9bce9fa87 100644
--- a/scripts/mysql_secure_installation.sh
+++ b/scripts/mysql_secure_installation.sh
@@ -165,9 +165,9 @@ then
exit 1
fi
-# Now we can get arguments from the group [client]
+# Now we can get arguments from the group [client] and [client-server]
# in the my.cfg file, then re-run to merge with command line arguments.
-parse_arguments `$print_defaults $defaults client`
+parse_arguments `$print_defaults $defaults client client-server client-mariadb`
parse_arguments PICK-ARGS-FROM-ARGV "$@"
# Configure paths to support files
diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql
index 9742a046371..bfa9e9fbd37 100644
--- a/scripts/mysql_system_tables.sql
+++ b/scripts/mysql_system_tables.sql
@@ -30,7 +30,7 @@ set @had_db_table= @@warning_count != 0;
CREATE TABLE IF NOT EXISTS host ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Host privileges; Merged with database privileges';
-CREATE TABLE IF NOT EXISTS user ( Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Password char(41) character set latin1 collate latin1_bin DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Reload_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Shutdown_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Process_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, File_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_db_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Super_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Repl_slave_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Repl_client_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_user_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Event_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, ssl_type enum('','ANY','X509', 'SPECIFIED') COLLATE utf8_general_ci DEFAULT '' NOT NULL, ssl_cipher BLOB NOT NULL, x509_issuer BLOB NOT NULL, x509_subject BLOB NOT NULL, max_questions int(11) unsigned DEFAULT 0 NOT NULL, max_updates int(11) unsigned DEFAULT 0 NOT NULL, max_connections int(11) unsigned DEFAULT 0 NOT NULL, max_user_connections int(11) unsigned DEFAULT 0 NOT NULL, PRIMARY KEY Host (Host,User) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Users and global privileges';
+CREATE TABLE IF NOT EXISTS user ( Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Password char(41) character set latin1 collate latin1_bin DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Reload_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Shutdown_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Process_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, File_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_db_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Super_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Repl_slave_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Repl_client_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_user_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Event_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, ssl_type enum('','ANY','X509', 'SPECIFIED') COLLATE utf8_general_ci DEFAULT '' NOT NULL, ssl_cipher BLOB NOT NULL, x509_issuer BLOB NOT NULL, x509_subject BLOB NOT NULL, max_questions int(11) unsigned DEFAULT 0 NOT NULL, max_updates int(11) unsigned DEFAULT 0 NOT NULL, max_connections int(11) unsigned DEFAULT 0 NOT NULL, max_user_connections int(11) unsigned DEFAULT 0 NOT NULL, plugin char(60) CHARACTER SET latin1 DEFAULT '' NOT NULL, auth_string TEXT NOT NULL, PRIMARY KEY Host (Host,User) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Users and global privileges';
-- Remember for later if user table already existed
set @had_user_table= @@warning_count != 0;
@@ -77,7 +77,7 @@ CREATE TABLE IF NOT EXISTS time_zone_transition_type ( Time_zone_id int unsign
CREATE TABLE IF NOT EXISTS time_zone_leap_second ( Transition_time bigint signed NOT NULL, Correction int signed NOT NULL, PRIMARY KEY TranTime (Transition_time) ) engine=MyISAM CHARACTER SET utf8 comment='Leap seconds information for time zones';
-CREATE TABLE IF NOT EXISTS proc (db char(64) collate utf8_bin DEFAULT '' NOT NULL, name char(64) DEFAULT '' NOT NULL, type enum('FUNCTION','PROCEDURE') NOT NULL, specific_name char(64) DEFAULT '' NOT NULL, language enum('SQL') DEFAULT 'SQL' NOT NULL, sql_data_access enum( 'CONTAINS_SQL', 'NO_SQL', 'READS_SQL_DATA', 'MODIFIES_SQL_DATA') DEFAULT 'CONTAINS_SQL' NOT NULL, is_deterministic enum('YES','NO') DEFAULT 'NO' NOT NULL, security_type enum('INVOKER','DEFINER') DEFAULT 'DEFINER' NOT NULL, param_list blob NOT NULL, returns longblob DEFAULT '' NOT NULL, body longblob NOT NULL, definer char(77) collate utf8_bin DEFAULT '' NOT NULL, created timestamp, modified timestamp, sql_mode set( 'REAL_AS_FLOAT', 'PIPES_AS_CONCAT', 'ANSI_QUOTES', 'IGNORE_SPACE', 'NOT_USED', 'ONLY_FULL_GROUP_BY', 'NO_UNSIGNED_SUBTRACTION', 'NO_DIR_IN_CREATE', 'POSTGRESQL', 'ORACLE', 'MSSQL', 'DB2', 'MAXDB', 'NO_KEY_OPTIONS', 'NO_TABLE_OPTIONS', 'NO_FIELD_OPTIONS', 'MYSQL323', 'MYSQL40', 'ANSI', 'NO_AUTO_VALUE_ON_ZERO', 'NO_BACKSLASH_ESCAPES', 'STRICT_TRANS_TABLES', 'STRICT_ALL_TABLES', 'NO_ZERO_IN_DATE', 'NO_ZERO_DATE', 'INVALID_DATES', 'ERROR_FOR_DIVISION_BY_ZERO', 'TRADITIONAL', 'NO_AUTO_CREATE_USER', 'HIGH_NOT_PRECEDENCE', 'NO_ENGINE_SUBSTITUTION', 'PAD_CHAR_TO_FULL_LENGTH') DEFAULT '' NOT NULL, comment char(64) collate utf8_bin DEFAULT '' NOT NULL, character_set_client char(32) collate utf8_bin, collation_connection char(32) collate utf8_bin, db_collation char(32) collate utf8_bin, body_utf8 longblob, PRIMARY KEY (db,name,type)) engine=MyISAM character set utf8 comment='Stored Procedures';
+CREATE TABLE IF NOT EXISTS proc (db char(64) collate utf8_bin DEFAULT '' NOT NULL, name char(64) DEFAULT '' NOT NULL, type enum('FUNCTION','PROCEDURE') NOT NULL, specific_name char(64) DEFAULT '' NOT NULL, language enum('SQL') DEFAULT 'SQL' NOT NULL, sql_data_access enum( 'CONTAINS_SQL', 'NO_SQL', 'READS_SQL_DATA', 'MODIFIES_SQL_DATA') DEFAULT 'CONTAINS_SQL' NOT NULL, is_deterministic enum('YES','NO') DEFAULT 'NO' NOT NULL, security_type enum('INVOKER','DEFINER') DEFAULT 'DEFINER' NOT NULL, param_list blob NOT NULL, returns longblob DEFAULT '' NOT NULL, body longblob NOT NULL, definer char(77) collate utf8_bin DEFAULT '' NOT NULL, created timestamp, modified timestamp, sql_mode set( 'REAL_AS_FLOAT', 'PIPES_AS_CONCAT', 'ANSI_QUOTES', 'IGNORE_SPACE', 'IGNORE_BAD_TABLE_OPTIONS', 'ONLY_FULL_GROUP_BY', 'NO_UNSIGNED_SUBTRACTION', 'NO_DIR_IN_CREATE', 'POSTGRESQL', 'ORACLE', 'MSSQL', 'DB2', 'MAXDB', 'NO_KEY_OPTIONS', 'NO_TABLE_OPTIONS', 'NO_FIELD_OPTIONS', 'MYSQL323', 'MYSQL40', 'ANSI', 'NO_AUTO_VALUE_ON_ZERO', 'NO_BACKSLASH_ESCAPES', 'STRICT_TRANS_TABLES', 'STRICT_ALL_TABLES', 'NO_ZERO_IN_DATE', 'NO_ZERO_DATE', 'INVALID_DATES', 'ERROR_FOR_DIVISION_BY_ZERO', 'TRADITIONAL', 'NO_AUTO_CREATE_USER', 'HIGH_NOT_PRECEDENCE', 'NO_ENGINE_SUBSTITUTION', 'PAD_CHAR_TO_FULL_LENGTH') DEFAULT '' NOT NULL, comment char(64) collate utf8_bin DEFAULT '' NOT NULL, character_set_client char(32) collate utf8_bin, collation_connection char(32) collate utf8_bin, db_collation char(32) collate utf8_bin, body_utf8 longblob, PRIMARY KEY (db,name,type)) engine=MyISAM character set utf8 comment='Stored Procedures';
CREATE TABLE IF NOT EXISTS procs_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Routine_name char(64) COLLATE utf8_general_ci DEFAULT '' NOT NULL, Routine_type enum('FUNCTION','PROCEDURE') NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Proc_priv set('Execute','Alter Routine','Grant') COLLATE utf8_general_ci DEFAULT '' NOT NULL, Timestamp timestamp(14), PRIMARY KEY (Host,Db,User,Routine_name,Routine_type), KEY Grantor (Grantor) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Procedure privileges';
@@ -97,7 +97,7 @@ PREPARE stmt FROM @str;
EXECUTE stmt;
DROP PREPARE stmt;
-CREATE TABLE IF NOT EXISTS event ( db char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', name char(64) CHARACTER SET utf8 NOT NULL default '', body longblob NOT NULL, definer char(77) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', execute_at DATETIME default NULL, interval_value int(11) default NULL, interval_field ENUM('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK','SECOND','MICROSECOND','YEAR_MONTH','DAY_HOUR','DAY_MINUTE','DAY_SECOND','HOUR_MINUTE','HOUR_SECOND','MINUTE_SECOND','DAY_MICROSECOND','HOUR_MICROSECOND','MINUTE_MICROSECOND','SECOND_MICROSECOND') default NULL, created TIMESTAMP NOT NULL, modified TIMESTAMP NOT NULL, last_executed DATETIME default NULL, starts DATETIME default NULL, ends DATETIME default NULL, status ENUM('ENABLED','DISABLED','SLAVESIDE_DISABLED') NOT NULL default 'ENABLED', on_completion ENUM('DROP','PRESERVE') NOT NULL default 'DROP', sql_mode set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH') DEFAULT '' NOT NULL, comment char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', originator INTEGER UNSIGNED NOT NULL, time_zone char(64) CHARACTER SET latin1 NOT NULL DEFAULT 'SYSTEM', character_set_client char(32) collate utf8_bin, collation_connection char(32) collate utf8_bin, db_collation char(32) collate utf8_bin, body_utf8 longblob, PRIMARY KEY (db, name) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT 'Events';
+CREATE TABLE IF NOT EXISTS event ( db char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', name char(64) CHARACTER SET utf8 NOT NULL default '', body longblob NOT NULL, definer char(77) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', execute_at DATETIME default NULL, interval_value int(11) default NULL, interval_field ENUM('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK','SECOND','MICROSECOND','YEAR_MONTH','DAY_HOUR','DAY_MINUTE','DAY_SECOND','HOUR_MINUTE','HOUR_SECOND','MINUTE_SECOND','DAY_MICROSECOND','HOUR_MICROSECOND','MINUTE_MICROSECOND','SECOND_MICROSECOND') default NULL, created TIMESTAMP NOT NULL, modified TIMESTAMP NOT NULL, last_executed DATETIME default NULL, starts DATETIME default NULL, ends DATETIME default NULL, status ENUM('ENABLED','DISABLED','SLAVESIDE_DISABLED') NOT NULL default 'ENABLED', on_completion ENUM('DROP','PRESERVE') NOT NULL default 'DROP', sql_mode set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','IGNORE_BAD_TABLE_OPTIONS','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH') DEFAULT '' NOT NULL, comment char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', originator INTEGER UNSIGNED NOT NULL, time_zone char(64) CHARACTER SET latin1 NOT NULL DEFAULT 'SYSTEM', character_set_client char(32) collate utf8_bin, collation_connection char(32) collate utf8_bin, db_collation char(32) collate utf8_bin, body_utf8 longblob, PRIMARY KEY (db, name) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT 'Events';
CREATE TABLE IF NOT EXISTS ndb_binlog_index (Position BIGINT UNSIGNED NOT NULL, File VARCHAR(255) NOT NULL, epoch BIGINT UNSIGNED NOT NULL, inserts BIGINT UNSIGNED NOT NULL, updates BIGINT UNSIGNED NOT NULL, deletes BIGINT UNSIGNED NOT NULL, schemaops BIGINT UNSIGNED NOT NULL, PRIMARY KEY(epoch)) ENGINE=MYISAM;
diff --git a/scripts/mysql_system_tables_data.sql b/scripts/mysql_system_tables_data.sql
index e82d5412d75..583c44fe51c 100644
--- a/scripts/mysql_system_tables_data.sql
+++ b/scripts/mysql_system_tables_data.sql
@@ -37,9 +37,9 @@ DROP TABLE tmp_db;
-- from local machine if "users" table didn't exist before
CREATE TEMPORARY TABLE tmp_user LIKE user;
set @current_hostname= @@hostname;
-INSERT INTO tmp_user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0);
-REPLACE INTO tmp_user SELECT @current_hostname,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0 FROM dual WHERE LOWER( @current_hostname) != 'localhost';
-REPLACE INTO tmp_user VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0);
+INSERT INTO tmp_user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0,'','');
+REPLACE INTO tmp_user SELECT @current_hostname,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0,'','' FROM dual WHERE LOWER( @current_hostname) != 'localhost';
+REPLACE INTO tmp_user VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0,'','');
INSERT INTO tmp_user (host,user) VALUES ('localhost','');
INSERT INTO tmp_user (host,user) SELECT @current_hostname,'' FROM dual WHERE LOWER(@current_hostname ) != 'localhost';
INSERT INTO user SELECT * FROM tmp_user WHERE @had_user_table=0;
diff --git a/scripts/mysql_system_tables_fix.sql b/scripts/mysql_system_tables_fix.sql
index 6d0c10bc31d..a50cffd0cec 100644
--- a/scripts/mysql_system_tables_fix.sql
+++ b/scripts/mysql_system_tables_fix.sql
@@ -400,7 +400,7 @@ ALTER TABLE proc MODIFY name char(64) DEFAULT '' NOT NULL,
'PIPES_AS_CONCAT',
'ANSI_QUOTES',
'IGNORE_SPACE',
- 'NOT_USED',
+ 'IGNORE_BAD_TABLE_OPTIONS',
'ONLY_FULL_GROUP_BY',
'NO_UNSIGNED_SUBTRACTION',
'NO_DIR_IN_CREATE',
@@ -514,14 +514,14 @@ ALTER TABLE db MODIFY Event_priv enum('N','Y') character set utf8 DEFAULT 'N' NO
ALTER TABLE event DROP PRIMARY KEY;
ALTER TABLE event ADD PRIMARY KEY(db, name);
# Add sql_mode column just in case.
-ALTER TABLE event ADD sql_mode set ('NOT_USED') AFTER on_completion;
+ALTER TABLE event ADD sql_mode set ('IGNORE_BAD_TABLE_OPTIONS') AFTER on_completion;
# Update list of sql_mode values.
ALTER TABLE event MODIFY sql_mode
set('REAL_AS_FLOAT',
'PIPES_AS_CONCAT',
'ANSI_QUOTES',
'IGNORE_SPACE',
- 'NOT_USED',
+ 'IGNORE_BAD_TABLE_OPTIONS',
'ONLY_FULL_GROUP_BY',
'NO_UNSIGNED_SUBTRACTION',
'NO_DIR_IN_CREATE',
@@ -601,6 +601,9 @@ ALTER TABLE db MODIFY Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT
UPDATE user SET Trigger_priv=Super_priv WHERE @hadTriggerPriv = 0;
+ALTER TABLE user ADD plugin char(60) CHARACTER SET latin1 DEFAULT '' NOT NULL, ADD auth_string TEXT NOT NULL;
+ALTER TABLE user MODIFY plugin char(60) CHARACTER SET latin1 DEFAULT '' NOT NULL;
+
# Activate the new, possible modified privilege tables
# This should not be needed, but gives us some extra testing that the above
# changes was correct
diff --git a/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh
index 176953691a9..ad6584f0571 100644
--- a/scripts/mysqld_multi.sh
+++ b/scripts/mysqld_multi.sh
@@ -217,7 +217,7 @@ sub defaults_for_group
sub init_log
{
- foreach my $opt (defaults_for_group('mysqld'))
+ foreach my $opt (defaults_for_group('mysqld mariadb'))
{
if ($opt =~ m/^--datadir=(.*)/ && -d "$1" && -w "$1")
{
diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh
index e4e5f1a1510..cae63343cfc 100644
--- a/scripts/mysqld_safe.sh
+++ b/scripts/mysqld_safe.sh
@@ -159,9 +159,13 @@ parse_arguments() {
case "$arg" in
# these get passed explicitly to mysqld
--basedir=*) MY_BASEDIR_VERSION="$val" ;;
- --datadir=*) DATADIR="$val" ;;
+ --datadir=*|--data=*) DATADIR="$val" ;;
--pid-file=*) pid_file="$val" ;;
--user=*) user="$val"; SET_USER=1 ;;
+ --log-basename=*|--hostname=*|--loose-log-basename=*)
+ pid_file="$val.pid";
+ err_log="$val.err";
+ ;;
# these might have been set in a [mysqld_safe] section of my.cnf
# they are added to mysqld command line to override settings from my.cnf
@@ -313,7 +317,7 @@ append_arg_to_args () {
args=
SET_USER=2
-parse_arguments `$print_defaults $defaults --loose-verbose mysqld server`
+parse_arguments `$print_defaults $defaults --loose-verbose mysqld mariadb server client-server`
if test $SET_USER -eq 2
then
SET_USER=0
@@ -411,7 +415,11 @@ safe_mysql_unix_port=${mysql_unix_port:-${MYSQL_UNIX_PORT:-@MYSQL_UNIX_ADDR@}}
mysql_unix_port_dir=`dirname $safe_mysql_unix_port`
if [ ! -d $mysql_unix_port_dir ]
then
- mkdir $mysql_unix_port_dir
+ if ! `mkdir -p $mysql_unix_port_dir`
+ then
+ echo "Fatal error Can't create database directory '$mysql_unix_port'"
+ exit 1
+ fi
chown $user $mysql_unix_port_dir
chmod 755 $mysql_unix_port_dir
fi
@@ -434,14 +442,14 @@ fi
if test -z "$pid_file"
then
- pid_file="$DATADIR/`@HOSTNAME@`.pid"
-else
- case "$pid_file" in
- /* ) ;;
- * ) pid_file="$DATADIR/$pid_file" ;;
- esac
+ pid_file="`@HOSTNAME@`.pid"
fi
+# MariaDB wants pid file without datadir
append_arg_to_args "--pid-file=$pid_file"
+case "$pid_file" in
+ /* ) ;;
+ * ) pid_file="$DATADIR/$pid_file" ;;
+esac
if test -n "$mysql_unix_port"
then
diff --git a/scripts/mysqldumpslow.sh b/scripts/mysqldumpslow.sh
index 776b7d06a2d..3694526c944 100644
--- a/scripts/mysqldumpslow.sh
+++ b/scripts/mysqldumpslow.sh
@@ -38,13 +38,13 @@ GetOptions(\%opt,
'v|verbose+',# verbose
'help+', # write usage info
'd|debug+', # debug
- 's=s', # what to sort by (al, at, ar, c, t, l, r)
+ 's=s', # what to sort by (al, at, ar, ae, c, t, l, r, e)
'r!', # reverse the sort order (largest last instead of first)
't=i', # just show the top n queries
'a!', # don't abstract all numbers to N and strings to 'S'
'n=i', # abstract numbers with at least n digits within names
'g=s', # grep: only consider stmts that include this string
- 'h=s', # hostname of db server for *-slow.log filename (can be wildcard)
+ 'h=s', # hostname/basename of db server for *-slow.log filename (can be wildcard)
'i=s', # name of server instance (if using mysql.server startup script)
'l!', # don't subtract lock time from total time
) or usage("bad option");
@@ -52,31 +52,42 @@ GetOptions(\%opt,
$opt{'help'} and usage();
unless (@ARGV) {
- my $defaults = `my_print_defaults mysqld`;
+ my $defaults = `my_print_defaults mysqld mariadb`;
my $datadir = ($defaults =~ m/--datadir=(.*)/g)[-1];
- my $slowlog = ($defaults =~ m/--log-slow-queries=(.*)/)[0];
if (!$datadir or $opt{i}) {
# determine the datadir from the instances section of /etc/my.cnf, if any
my $instances = `my_print_defaults instances`;
- die "Can't determine datadir from 'my_print_defaults mysqld' output: $defaults"
+ die "Can't determine datadir from 'my_print_defaults instances' output: $defaults"
unless $instances;
my @instances = ($instances =~ m/^--(\w+)-/mg);
die "No -i 'instance_name' specified to select among known instances: @instances.\n"
unless $opt{i};
die "Instance '$opt{i}' is unknown (known instances: @instances)\n"
unless grep { $_ eq $opt{i} } @instances;
- $datadir = ($instances =~ m/--$opt{i}-datadir=(.*)/)[0]
+ $datadir = ($instances =~ m/--$opt{i}-datadir=(.*)/g)[-1]
or die "Can't determine --$opt{i}-datadir from 'my_print_defaults instances' output: $instances";
warn "datadir=$datadir\n" if $opt{v};
}
- if ( -f $slowlog ) {
+ my $slowlog = ($defaults =~ m/--log[-_]slow[-_]queries=(.*)/g)[-1];
+ if (!$slowlog)
+ {
+ $slowlog = ($defaults =~ m/--slow[-_]query[-_]log[-_]file=(.*)/g)[-1];
+ }
+ if ( $slowlog )
+ {
@ARGV = ($slowlog);
die "Can't find '$slowlog'\n" unless @ARGV;
- } else {
- @ARGV = <$datadir/$opt{h}-slow.log>;
- die "Can't find '$datadir/$opt{h}-slow.log'\n" unless @ARGV;
+ }
+ else
+ {
+ if (!$opt{h})
+ {
+ $opt{h}= ($defaults =~ m/--log[-_]basename=(.*)/g)[-1];
+ }
+ @ARGV = <$datadir/$opt{h}-slow.log>;
+ die "Can't find '$datadir/$opt{h}-slow.log'\n" unless @ARGV;
}
}
@@ -98,8 +109,10 @@ while ( defined($_ = shift @pending) or defined($_ = <>) ) {
s/^#? Time: \d{6}\s+\d+:\d+:\d+.*\n//;
my ($user,$host) = s/^#? User\@Host:\s+(\S+)\s+\@\s+(\S+).*\n// ? ($1,$2) : ('','');
- s/^# Query_time: ([0-9.]+)\s+Lock_time: ([0-9.]+)\s+Rows_sent: ([0-9.]+).*\n//;
- my ($t, $l, $r) = ($1, $2, $3);
+ s/^# Thread_id: [0-9]+\s+Schema: [^\n]+\n//;
+ s/^# Query_time: ([0-9.]+)\s+Lock_time: ([0-9.]+)\s+Rows_sent: ([0-9.]+)\s+Rows_examined: ([0-9.]+).*\n//;
+ my ($t, $l, $r, $e) = ($1, $2, $3, $4);
+
$t -= $l unless $opt{l};
# remove fluff that mysqld writes to log when it (re)starts:
@@ -107,6 +120,11 @@ while ( defined($_ = shift @pending) or defined($_ = <>) ) {
s!^Tcp port: \d+ Unix socket: \S+\n!!mg;
s!^Time.*Id.*Command.*Argument.*\n!!mg;
+ # Remove optimizer info
+ s!^# QC_Hit: \S+\s+Full_scan: \S+\s+Full_join: \S+\s+Tmp_table: \S+\s+Tmp_table_on_disk: \S+[^\n]+\n!!mg;
+ s!^# Filesort: \S+\s+Filesort_on_disk: \S+[^\n]+\n!!mg;
+ s!^# Full_scan: \S+\s+Full_join: \S+[^\n]+\n!!mg;
+
s/^use \w+;\n//; # not consistently added
s/^SET timestamp=\d+;\n//;
@@ -136,6 +154,7 @@ while ( defined($_ = shift @pending) or defined($_ = <>) ) {
$s->{t} += $t;
$s->{l} += $l;
$s->{r} += $r;
+ $s->{e} += $e;
$s->{users}->{$user}++ if $user;
$s->{hosts}->{$host}++ if $host;
@@ -144,10 +163,11 @@ while ( defined($_ = shift @pending) or defined($_ = <>) ) {
foreach (keys %stmt) {
my $v = $stmt{$_} || die;
- my ($c, $t, $l, $r) = @{ $v }{qw(c t l r)};
+ my ($c, $t, $l, $r, $e) = @{ $v }{qw(c t l r e)};
$v->{at} = $t / $c;
$v->{al} = $l / $c;
$v->{ar} = $r / $c;
+ $v->{ae} = $e / $c;
}
my @sorted = sort { $stmt{$b}->{$opt{s}} <=> $stmt{$a}->{$opt{s}} } keys %stmt;
@@ -156,13 +176,13 @@ my @sorted = sort { $stmt{$b}->{$opt{s}} <=> $stmt{$a}->{$opt{s}} } keys %stmt;
foreach (@sorted) {
my $v = $stmt{$_} || die;
- my ($c, $t,$at, $l,$al, $r,$ar) = @{ $v }{qw(c t at l al r ar)};
+ my ($c, $t,$at, $l,$al, $r,$ar,$e, $ae) = @{ $v }{qw(c t at l al r ar e ae)};
my @users = keys %{$v->{users}};
my $user = (@users==1) ? $users[0] : sprintf "%dusers",scalar @users;
my @hosts = keys %{$v->{hosts}};
my $host = (@hosts==1) ? $hosts[0] : sprintf "%dhosts",scalar @hosts;
- printf "Count: %d Time=%.2fs (%ds) Lock=%.2fs (%ds) Rows=%.1f (%d), $user\@$host\n%s\n\n",
- $c, $at,$t, $al,$l, $ar,$r, $_;
+ printf "Count: %d Time=%.2fs (%ds) Lock=%.2fs (%ds) Rows_sent=%.1f (%d), Rows_examined=%.1f (%d), $user\@$host\n%s\n\n",
+ $c, $at,$t, $al,$l, $ar,$r, $ae, $e, $_;
}
sub usage {
@@ -178,7 +198,7 @@ Parse and summarize the MySQL slow query log. Options are
-v verbose
-d debug
- -s ORDER what to sort by (al, at, ar, c, l, r, t), 'at' is default
+ -s ORDER what to sort by (al, at, ar, ae, c, l, r, e, t), 'at' is default
al: average lock time
ar: average rows sent
at: average query time