Commit c664530d authored by unknown's avatar unknown

Merge pilot.blaudden:/home/msvensson/mysql/mysql-5.0-maint-bug20166

into  pilot.blaudden:/home/msvensson/mysql/mysql-5.1-new-maint


mysql-test/mysql-test-run.pl:
  Auto merged
scripts/Makefile.am:
  Auto merged
scripts/mysql_install_db.sh:
  Auto merged
scripts/mysql_system_tables_fix.sql:
  Auto merged
scripts/mysql_system_tables.sql:
  Manual merge
parents e9cce179 838e89de
...@@ -2919,16 +2919,21 @@ sub install_db ($$) { ...@@ -2919,16 +2919,21 @@ sub install_db ($$) {
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# Create the bootstrap.sql file # Create the bootstrap.sql file
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
my $bootstrap_sql_file= "$opt_vardir/tmp/bootstrap.sql$$"; my $bootstrap_sql_file= "$opt_vardir/tmp/bootstrap.sql";
# Use the mysql database for system tables # Use the mysql database for system tables
mtr_tofile($bootstrap_sql_file, "use mysql"); mtr_tofile($bootstrap_sql_file, "use mysql");
# Add the offical mysql system tables and initial system data # Add the offical mysql system tables
# for a prodcuction system # for a production system
mtr_appendfile_to_file("$path_sql_dir/mysql_system_tables.sql", mtr_appendfile_to_file("$path_sql_dir/mysql_system_tables.sql",
$bootstrap_sql_file); $bootstrap_sql_file);
# Add the mysql system tables initial data
# for a production system
mtr_appendfile_to_file("$path_sql_dir/mysql_system_tables_data.sql",
$bootstrap_sql_file);
# Add test data for timezone - this is just a subset, on a real # Add test data for timezone - this is just a subset, on a real
# system these tables will be populated either by mysql_tzinfo_to_sql # system these tables will be populated either by mysql_tzinfo_to_sql
# or by downloading the timezone table package from our website # or by downloading the timezone table package from our website
...@@ -2952,7 +2957,8 @@ sub install_db ($$) { ...@@ -2952,7 +2957,8 @@ sub install_db ($$) {
{ {
mtr_error("Error executing mysqld --bootstrap\n" . mtr_error("Error executing mysqld --bootstrap\n" .
"Could not install system database, see $path_bootstrap_log"); "Could not install system database from $bootstrap_sql_file\n" .
"see $path_bootstrap_log for errors");
} }
} }
......
...@@ -57,15 +57,14 @@ EXTRA_DIST = $(EXTRA_SCRIPTS) \ ...@@ -57,15 +57,14 @@ EXTRA_DIST = $(EXTRA_SCRIPTS) \
mysqlaccess.conf \ mysqlaccess.conf \
mysqlbug \ mysqlbug \
make_win_bin_dist \ make_win_bin_dist \
mysql_fix_privilege_tables.sql.in mysql_system_tables_fix.sql
dist_pkgdata_DATA = fill_help_tables.sql \ dist_pkgdata_DATA = fill_help_tables.sql \
mysql_fix_privilege_tables.sql \ mysql_fix_privilege_tables.sql \
mysql_system_tables.sql \ mysql_system_tables.sql \
mysql_system_tables_data.sql \
mysql_test_data_timezone.sql mysql_test_data_timezone.sql
# mysqlbug should be distributed built so that people can report build
# failures with it.
CLEANFILES = @server_scripts@ \ CLEANFILES = @server_scripts@ \
make_binary_distribution \ make_binary_distribution \
make_sharedlib_distribution \ make_sharedlib_distribution \
...@@ -83,8 +82,11 @@ CLEANFILES = @server_scripts@ \ ...@@ -83,8 +82,11 @@ CLEANFILES = @server_scripts@ \
mysqldumpslow \ mysqldumpslow \
mysql_tableinfo \ mysql_tableinfo \
mysqld_multi \ mysqld_multi \
mysql_create_system_tables mysql_create_system_tables \
mysql_fix_privilege_tables.sql
# mysqlbug should be distributed built so that people can report build
# failures with it.
DISTCLEANFILES = mysqlbug DISTCLEANFILES = mysqlbug
# We want the right version and configure comand line in mysqlbug # We want the right version and configure comand line in mysqlbug
...@@ -93,10 +95,10 @@ mysqlbug: ${top_builddir}/config.status mysqlbug.sh ...@@ -93,10 +95,10 @@ mysqlbug: ${top_builddir}/config.status mysqlbug.sh
# Build mysql_fix_privilege_tables.sql from the files that contain # Build mysql_fix_privilege_tables.sql from the files that contain
# the system tables for this version of MySQL plus any commands # the system tables for this version of MySQL plus any commands
# needed to upgrade the system tables from an older version # needed to upgrade the system tables from an older version
mysql_fix_privilege_tables.sql: mysql_fix_privilege_tables.sql.in \ mysql_fix_privilege_tables.sql: mysql_system_tables.sql \
mysql_system_tables.sql mysql_system_tables_fix.sql
@echo "Building $@"; @echo "Building $@";
@cat mysql_system_tables.sql $@.in > $@ @cat mysql_system_tables.sql mysql_system_tables_fix.sql > $@
SUFFIXES = .sh SUFFIXES = .sh
......
...@@ -138,10 +138,12 @@ fi ...@@ -138,10 +138,12 @@ fi
# Find SQL scripts needed for bootstrap # Find SQL scripts needed for bootstrap
fill_help_tables="fill_help_tables.sql" fill_help_tables="fill_help_tables.sql"
create_system_tables="mysql_system_tables.sql" create_system_tables="mysql_system_tables.sql"
fill_system_tables="mysql_system_tables_data.sql"
if test -n "$srcdir" if test -n "$srcdir"
then then
fill_help_tables=$srcdir/scripts/$fill_help_tables fill_help_tables=$srcdir/scripts/$fill_help_tables
create_system_tables=$srcdir/scripts/$create_system_tables create_system_tables=$srcdir/scripts/$create_system_tables
fill_system_tables=$srcdir/scripts/$fill_system_tables
else else
for i in $basedir/support-files $basedir/share $basedir/share/mysql \ for i in $basedir/support-files $basedir/share $basedir/share/mysql \
$basedir/scripts `pwd` `pwd`/scripts @pkgdatadir@ $basedir/scripts `pwd` `pwd`/scripts @pkgdatadir@
...@@ -154,6 +156,7 @@ else ...@@ -154,6 +156,7 @@ else
fill_help_tables=$pkgdatadir/$fill_help_tables fill_help_tables=$pkgdatadir/$fill_help_tables
create_system_tables=$pkgdatadir/$create_system_tables create_system_tables=$pkgdatadir/$create_system_tables
fill_system_tables=$pkgdatadir/$fill_system_tables
fi fi
if test ! -f $create_system_tables if test ! -f $create_system_tables
...@@ -170,6 +173,13 @@ then ...@@ -170,6 +173,13 @@ then
exit 1; exit 1;
fi fi
if test ! -f $fill_system_tables
then
echo "FATAL ERROR: Could not find help file '$fill_system_tables' in"
echo "@pkgdatadir@ or inside $basedir"
exit 1;
fi
# Find executables and paths # Find executables and paths
mdata=$ldata/mysql mdata=$ldata/mysql
mysqld=$execdir/mysqld mysqld=$execdir/mysqld
...@@ -273,7 +283,7 @@ mysqld_install_cmd_line="$mysqld_bootstrap $defaults $mysqld_opt --bootstrap \ ...@@ -273,7 +283,7 @@ mysqld_install_cmd_line="$mysqld_bootstrap $defaults $mysqld_opt --bootstrap \
# Pipe mysql_system_tables.sql to "mysqld --bootstrap" # Pipe mysql_system_tables.sql to "mysqld --bootstrap"
s_echo "Installing MySQL system tables..." s_echo "Installing MySQL system tables..."
if `(echo "use mysql;"; cat $create_system_tables) | $mysqld_install_cmd_line` if `(echo "use mysql;"; cat $create_system_tables $fill_system_tables) | $mysqld_install_cmd_line`
then then
s_echo "OK" s_echo "OK"
......
...@@ -6,10 +6,6 @@ set storage_engine=myisam; ...@@ -6,10 +6,6 @@ set storage_engine=myisam;
CREATE TABLE IF NOT EXISTS db ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) 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, 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, PRIMARY KEY Host (Host,Db,User), KEY User (User) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Database privileges'; CREATE TABLE IF NOT EXISTS db ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) 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, 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, PRIMARY KEY Host (Host,Db,User), KEY User (User) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Database privileges';
-- default grants for anyone to access database 'test' and 'test_%'
INSERT INTO db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N','Y','Y');
INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N','Y','Y');
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 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';
...@@ -63,11 +59,6 @@ CREATE TABLE IF NOT EXISTS proc ( db char(64) collate utf8_bin DEFAULT '' NOT NU ...@@ -63,11 +59,6 @@ CREATE TABLE IF NOT EXISTS proc ( db char(64) collate utf8_bin DEFAULT '' NOT NU
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) binary 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'; 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) binary 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';
-- default users allowing root access from local machine
INSERT INTO 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 user VALUES (@@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);
REPLACE INTO 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);
CREATE PROCEDURE create_general_log_table() BEGIN DECLARE is_csv_enabled int DEFAULT 0; SELECT @@have_csv = 'YES' INTO is_csv_enabled; IF (is_csv_enabled) THEN CREATE TABLE IF NOT EXISTS general_log (event_time TIMESTAMP NOT NULL, user_host MEDIUMTEXT, thread_id INTEGER, server_id INTEGER, command_type VARCHAR(64), argument MEDIUMTEXT) engine=CSV CHARACTER SET utf8 comment='General log'; END IF; END; CREATE PROCEDURE create_general_log_table() BEGIN DECLARE is_csv_enabled int DEFAULT 0; SELECT @@have_csv = 'YES' INTO is_csv_enabled; IF (is_csv_enabled) THEN CREATE TABLE IF NOT EXISTS general_log (event_time TIMESTAMP NOT NULL, user_host MEDIUMTEXT, thread_id INTEGER, server_id INTEGER, command_type VARCHAR(64), argument MEDIUMTEXT) engine=CSV CHARACTER SET utf8 comment='General log'; END IF; END;
CALL create_general_log_table(); CALL create_general_log_table();
...@@ -84,4 +75,3 @@ CREATE TABLE IF NOT EXISTS event ( db char(64) CHARACTER SET utf8 COLLATE utf8_b ...@@ -84,4 +75,3 @@ CREATE TABLE IF NOT EXISTS event ( db char(64) CHARACTER SET utf8 COLLATE utf8_b
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; 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;
--
-- The inital data for system tables of MySQL Server
--
-- default grants for anyone to access database 'test' and 'test_%'
INSERT INTO db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N');
INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N');
-- default users allowing root access from local machine
INSERT INTO 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','','','','',0,0,0,0);
REPLACE INTO user VALUES (@@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','','','','',0,0,0,0);
REPLACE INTO 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','','','','',0,0,0,0);
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