From 150496613cb9fc79ee3205dd3fc052f933942ba9 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 12 Mar 2007 13:15:43 +0100 Subject: add missing test cases to windows binary distribution --- scripts/make_win_bin_dist | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index 211eea8a265..ffd3712715a 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -291,6 +291,7 @@ cp mysql-test/mysql-test-run.pl $DESTDIR/mysql-test/ cp mysql-test/README $DESTDIR/mysql-test/ cp mysql-test/install_test_db.sh $DESTDIR/mysql-test/install_test_db cp mysql-test/include/*.inc $DESTDIR/mysql-test/include/ +cp mysql-test/include/*.test $DESTDIR/mysql-test/include/ cp mysql-test/lib/*.pl $DESTDIR/mysql-test/lib/ cp mysql-test/lib/*.sql $DESTDIR/mysql-test/lib/ cp mysql-test/r/*.require $DESTDIR/mysql-test/r/ -- cgit v1.2.1 From 189398b359c1eb512a417c10b99f10fb2614d098 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 16 Mar 2007 11:52:30 +0100 Subject: Bug#27022 Install fails with Duplicate entry '%-test-' for key 'PRIMARY' - Bail out with error if MySQL System tables already exist scripts/mysql_install_db.sh: Bail out with error if the MySQL system tables already exist in the location where we want to install --- scripts/mysql_install_db.sh | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 5dd5d86c666..c1a27eb0bc8 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -135,6 +135,17 @@ else fi fi +# Check that no previous MySQL installation exist +if test -f "$ldata/mysql/db.frm" +then + echo "FATAL ERROR: Found already existing MySQL system tables" + echo "in $ldata." + echo "If you are upgrading from a previous MySQL version you" + echo "should run '$bindir/mysql_upgrade', " + echo "to upgrade all tables for this version of MySQL" + exit 1; +fi + # Find SQL scripts needed for bootstrap fill_help_tables="fill_help_tables.sql" create_system_tables="mysql_system_tables.sql" @@ -181,7 +192,6 @@ then fi # Find executables and paths -mdata=$ldata/mysql mysqld=$execdir/mysqld mysqld_opt="" scriptdir=$bindir @@ -264,12 +274,6 @@ if test -w / -a ! -z "$user"; then chown $user $ldata $ldata/mysql $ldata/test; fi -# Check is "db" table already exist -if test ! -f $mdata/db.frm -then - db_table_already_exist="yes" -fi - if test -n "$user"; then args="$args --user=$user" fi @@ -322,16 +326,6 @@ then echo "$bindir/mysqladmin -u root -h $hostname password 'new-password'" echo "See the manual for more instructions." - # Print message about upgrading unless we have created a new db table. - if test -z "$db_table_already_exist" - then - echo - echo "NOTE: If you are upgrading from a previous MySQL verision you " - echo "should run '$bindir/mysql_upgrade', to make sure all tables have " - echo "been upgraded for this version of MySQL" - fi - echo - if test "$in_rpm" = "0" then echo "You can start the MySQL daemon with:" -- cgit v1.2.1 From 62b41b5fbcf3fe8bd680e28e0064d3194daf4157 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 16 Mar 2007 09:56:57 -0400 Subject: WL#3629 - Replication of Invocation and Invoked Features This changeset adds replication of events and user-defined functions. There are several bug reports involved in this change: BUG#16421, BUG#17857, BUG#20384: This patch modifies the mysql.events table to permit the addition of another enum value for the status column. The column now has values of ('DISABLED','SLAVESIDE_DISABLED','ENABLED'). A status of SLAVESIDE_DISABLED is set on the slave during replication of events. This enables users to determine which events werereplicated from the master and to later enable them if they promote the slave to a master. The CREATE, ALTER, and DROP statements are binlogged. A new test was added for replication of events (rpl_events). BUG#17671: This patch modifies the code to permit logging of user-defined functions. Note: this is the CREATE FUNCTION ... SONAME variety. A more friendly error message to be displayed should a replicated user-defined function not be found in the loadable library or if the library is missing from the slave.The CREATE andDROP statements are binlogged. A new test was added for replication of user-defined functions (rpl_udf). The patch also adds a new column to the mysql.event table named 'originator' that is used to store the server_id of the server that the event originated on. This enables users to promote a slave to a master and later return the promoted slave to a slave and disable the replicated events. mysql-test/lib/init_db.sql: WL#3629 - Replication of Invocation and Invoked Feature This patch adds the SLAVESIDE_DISABLED to the list of enumerated values for the mysql.event table. This patch adds the column 'originator' to the mysql.event table. mysql-test/r/events.result: WL#3629 - Replication of Invocation and Invoked Feature This patch adds the 'originator' column to the events test results. This was necessary to ensure the manual insert into mysql.event table succeeds because the originator column is set to NOT NULL. mysql-test/r/events_grant.result: WL#3629 - Replication of Invocation and Invoked Feature This patch adds the 'originator' column to the events_grant test results. This was necessary to ensure the manual insert into mysql.event table succeeds because the originator column is set to NOT NULL. mysql-test/r/events_restart_phase1.result: WL#3629 - Replication of Invocation and Invoked Feature This patch adds the 'originator' column to the events_restart_phase1 test results. This was necessary to ensure the manual insert into mysql.event table succeeds because the originator column is set to NOT NULL. mysql-test/r/system_mysql_db.result: WL#3629 - Replication of Invocation and Invoked Feature This patch adds the SLAVESIDE_DISABLED to the list of enumerated values for the mysql.event table. This patch adds the column 'originator' to the mysql.event table. These changes to the result file were necessary to ensure correct test results. mysql-test/t/events.test: WL#3629 - Replication of Invocation and Invoked Feature This patch adds the 'originator' column to the events test. This was necessary to ensure the manual insert into mysql.event table succeeds because the originator column is set to NOT NULL. mysql-test/t/events_restart_phase1.test: WL#3629 - Replication of Invocation and Invoked Feature This patch adds the 'originator' column to the events_restart_phase1 test. This was necessary to ensure the manual insert into mysql.event table succeeds because the originator column is set to NOT NULL. scripts/mysql_create_system_tables.sh: WL#3629 - Replication of Invocation and Invoked Feature This patch adds the SLAVESIDE_DISABLED to the list of enumerated values for the mysql.event table. This patch adds the column 'originator' to the mysql.event table. scripts/mysql_fix_privilege_tables.sql: WL#3629 - Replication of Invocation and Invoked Feature This patch adds the SLAVESIDE_DISABLED to the list of enumerated values for the mysql.event table. This patch adds the column 'originator' to the mysql.event table. sql/event_data_objects.cc: WL#3629 - Replication of Invocation and Invoked Features This patch modifies the code to permit processing of the new enum SLAVESIDE_DISABLED which is set on the slave during replication of events. This patch uses the new Event_basic:: enumerated values. sql/event_data_objects.h: WL#3629 - Replication of Invocation and Invoked Features This patch moves the duplicated enumeration values for ENABLED, SLAVESIDE_DISABLED, and DISABLED to the Event_basic class removing them from the other Event_* classes. sql/event_db_repository.cc: WL#3629 - Replication of Invocation and Invoked Features This patch modifies the code to permit processing of the new enum SLAVESIDE_DISABLED which is set on the slave during replication of events. The patch also adds a new column to the mysql.event table named 'originator' that is used to store the server_id of the server that the event originated on. This enables users to promote a slave to a master and later return the promoted slave to a slave and disable the replicated events. sql/event_db_repository.h: WL#3629 - Replication of Invocation and Invoked Features This patch modifies the code to add a new field named 'originator' to the enum_event_table_field and associated structure. sql/event_queue.cc: WL#3629 - Replication of Invocation and Invoked Features This patch modifies the code to permit processing of the new enum SLAVESIDE_DISABLED which is set on the slave during replication of events. sql/events.cc: WL#3629 - Replication of Invocation and Invoked Features This patch modifies the code to permit processing of the new enum SLAVESIDE_DISABLED which is set on the slave during replication of events. sql/lex.h: WL#3629 - Replication of Invocation and Invoked Features This patch modifies the code to add the new SLAVESIDE_DISABLE symbol to the lexical parser. sql/slave.cc: WL#3629 - Replication of Invocation and Invoked Features This patch modifies the code to permit the capture of the error on the slave when a UDF from a loadable library is not loaded on the server when replicated from the master. sql/sql_parse.cc: WL#3629 - Replication of Invocation and Invoked Features This patch removes the comment because drop functions commands are replicated. sql/sql_show.cc: WL#3629 - Replication of Invocation and Invoked Features This patch modifies the code to permit processing of the new enum SLAVESIDE_DISABLED which is set on the slave during replication of events. The code also adds changes the display width of the status column for the schema table for the show events command and also adds the new column 'originator' to the events_field_info structure. sql/sql_udf.cc: WL#3629 - Replication of Invocation and Invoked Features This patch modifies the code to add the binlogging of the create and drop function events. sql/sql_yacc.yy: WL#3629 - Replication of Invocation and Invoked Features This patch modifies the code to change the enumeration of the status column for the events in the parser. The code uses the Event_basic:: enumerations allowing the enums to be defined in one place. mysql-test/t/rpl_events.test: WL#3629 - Replication of Invocation and Invoked Features This patch adds a new test for testing replication of events. The test uses include files so that the test can test under both RBR and SBR. mysql-test/r/rpl_events.result: WL#3629 - Replication of Invocation and Invoked Features This patch adds a new result file for testing replication of events. mysql-test/r/rpl_udf.result: WL#3629 - Replication of Invocation and Invoked Features This patch adds a new result file for testing replication of UDFs. mysql-test/t/rpl_udf.test: WL#3629 - Replication of Invocation and Invoked Features This patch adds a new test for testing replication of UDFs. The test uses include files so that the test can test under both RBR and SBR. mysql-test/include/rpl_events.inc: WL#3629 - Replication of Invocation and Invoked Features This patch adds a new include file for testing replication of events. This file contains the core test procedures. mysql-test/include/rpl_udf.inc: WL#3629 - Replication of Invocation and Invoked Features This patch adds a new include file for testing replication of UDFs. This file contains the core test procedures. --- scripts/mysql_create_system_tables.sh | 3 ++- scripts/mysql_fix_privilege_tables.sql | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index cc86def1a5c..ddb90b55633 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -832,7 +832,7 @@ then c_ev="$c_ev last_executed DATETIME default NULL," c_ev="$c_ev starts DATETIME default NULL," c_ev="$c_ev ends DATETIME default NULL," - c_ev="$c_ev status ENUM('ENABLED','DISABLED') NOT NULL default 'ENABLED'," + c_ev="$c_ev status ENUM('ENABLED','DISABLED','SLAVESIDE_DISABLED') NOT NULL default 'ENABLED'," c_ev="$c_ev on_completion ENUM('DROP','PRESERVE') NOT NULL default 'DROP'," c_ev="$c_ev sql_mode set(" c_ev="$c_ev 'REAL_AS_FLOAT'," @@ -867,6 +867,7 @@ then c_ev="$c_ev 'HIGH_NOT_PRECEDENCE'" c_ev="$c_ev ) DEFAULT '' NOT NULL," c_ev="$c_ev comment char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default ''," + c_ev="$c_ev originator int(10) NOT NULL, c_ev="$c_ev PRIMARY KEY (db, name)" c_ev="$c_ev ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT 'Events';" fi diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index 9cdea507493..4d661dd8146 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -648,7 +648,7 @@ CREATE TABLE event ( last_executed DATETIME default NULL, starts DATETIME default NULL, ends DATETIME default NULL, - status ENUM('ENABLED','DISABLED') NOT NULL default 'ENABLED', + 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', @@ -683,6 +683,7 @@ CREATE TABLE event ( 'HIGH_NOT_PRECEDENCE' ) DEFAULT '' NOT NULL, comment char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', + originator int(10) NOT NULL, PRIMARY KEY (db,name) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT 'Events'; @@ -737,6 +738,8 @@ ALTER TABLE event ADD sql_mode UPDATE user SET Event_priv=Super_priv WHERE @hadEventPriv = 0; ALTER TABLE event MODIFY name char(64) CHARACTER SET utf8 NOT NULL default ''; +ALTER TABLE event ADD COLUMN originator INT(10) NOT NULL; +ALTER TABLE event MODIFY COLUMN status ENUM('ENABLED','DISABLED','SLAVESIDE_DISABLED') NOT NULL default 'ENABLED'; # # TRIGGER privilege -- cgit v1.2.1 From 086fba76272c2350b71c93e4343ab5fb3ea5d7da Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 16 Mar 2007 17:31:07 +0300 Subject: BUG#16420: Events: timestamps become UTC BUG#26429: SHOW CREATE EVENT is incorrect for an event that STARTS NOW() BUG#26431: Impossible to re-create an event from backup if its STARTS clause is in the past WL#3698: Events: execution in local time zone The problem was that local times specified by the user in AT, STARTS and ENDS of CREATE EVENT/ALTER EVENT statement were converted to UTC, and the original time zone was forgotten. This way, event scheduler couldn't honor Daylight Saving Time shifts, and times shown to the user were also in UTC. Additionally, CREATE EVENT didn't allow times in the past, thus preventing straightforward event restoration from old backups. This patch reworks event scheduler time computations, performing them in the time zone associated with the event. Also it allows times to be in the past. The patch adds time_zone column to mysql.event table. NOTE: The patch is almost final, but the bug#9953 should be pushed first. client/mysqldump.c: Before every CREATE EVENT, output its time zone. mysql-test/include/wait_condition.inc: Add optional $wait_timeout parameter. mysql-test/lib/init_db.sql: Add time_zone column. mysql-test/r/events.result: Update result. mysql-test/r/events_bugs.result: Update result. mysql-test/r/events_grant.result: Update result. mysql-test/r/events_restart_phase1.result: Update result. mysql-test/r/events_scheduling.result: Update result. mysql-test/r/mysqldump.result: Update result. mysql-test/r/ps.result: Update result. mysql-test/r/system_mysql_db.result: Update result. mysql-test/t/events.test: Remove STARTS from the result, as it depends on current time. mysql-test/t/events_bugs.test: Time in the past is no longer an error. mysql-test/t/events_restart_phase1.test: Fill new column 'time_zone' in mysql.event. mysql-test/t/events_scheduling.test: Cleanup: disable event scheduler. scripts/mysql_create_system_tables.sh: Add new column 'time_zone' to mysql.event. scripts/mysql_fix_privilege_tables.sql: Add new column 'time_zone' to mysql.event. sql/event_data_objects.cc: The essence of the change is the following: - for internal times use my_time_t instead of TIME. Assignment and comparison is done now on plain numbers. - in init_execute_at(), init_starts(), init_ends() convert given time to number of seconds since Epoch (aka Unix time, in UTC). - handle time_zone field loading and storing. - in get_next_time(), Unix time is converted back to event time zone, interval is added, and the result is converted to UTC again. - fix Event_timed::get_create_event() to report STARTS and ENDS. - before executing the event body we set thread time zone to the event time zone. sql/event_data_objects.h: Add time_zone member to Event_basic class. Store internal times in my_time_t (number of seconds since Epoch), rather than in broken down TIME structure. sql/event_db_repository.cc: Add time_zone column handling. Give a warning and do not create an event if its execution time is in the past, and ON COMPLETION NOT PRESERVE is set, because such an event should be dropped by that time. Also, do not allow ALTER EVENT to set execution time in the past when ON COMPLETION NOT PRESERVE is set. sql/event_db_repository.h: Add enum member for new time zone column. sql/event_queue.cc: Replace handling of broken down times with simple handling of my_time_t. sql/event_queue.h: Store internal times in my_time_t (number of seconds since Epoch), rather than in broken down TIME structure. sql/event_scheduler.cc: Add TODO comment. sql/events.cc: Send time_zone column for SHOW CREATE EVENT. sql/share/errmsg.txt: Update error message, and add two more errors. sql/sql_show.cc: Add TIME_ZONE column to the output of SHOW EVENTS. mysql-test/r/events_time_zone.result: BitKeeper file /home/tomash/src/mysql_ab/mysql-5.1-wl3698/mysql-test/r/events_time_zone.result mysql-test/t/events_time_zone.test: BitKeeper file /home/tomash/src/mysql_ab/mysql-5.1-wl3698/mysql-test/t/events_time_zone.test --- scripts/mysql_create_system_tables.sh | 1 + scripts/mysql_fix_privilege_tables.sql | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index cc86def1a5c..808f4adc222 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -867,6 +867,7 @@ then c_ev="$c_ev 'HIGH_NOT_PRECEDENCE'" c_ev="$c_ev ) DEFAULT '' NOT NULL," c_ev="$c_ev comment char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default ''," + c_ev="$c_ev time_zone char(64) CHARACTER SET latin1 NOT NULL DEFAULT 'SYSTEM'," c_ev="$c_ev PRIMARY KEY (db, name)" c_ev="$c_ev ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT 'Events';" fi diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index 9cdea507493..9a966c653f2 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -683,6 +683,7 @@ CREATE TABLE event ( 'HIGH_NOT_PRECEDENCE' ) DEFAULT '' NOT NULL, comment char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', + time_zone char(64) CHARACTER SET latin1 NOT NULL DEFAULT 'SYSTEM', PRIMARY KEY (db,name) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT 'Events'; @@ -734,10 +735,12 @@ ALTER TABLE event ADD sql_mode 'NO_AUTO_CREATE_USER', 'HIGH_NOT_PRECEDENCE' ) DEFAULT '' NOT NULL AFTER on_completion; - UPDATE user SET Event_priv=Super_priv WHERE @hadEventPriv = 0; ALTER TABLE event MODIFY name char(64) CHARACTER SET utf8 NOT NULL default ''; +ALTER TABLE event ADD COLUMN time_zone char(64) CHARACTER SET latin1 + NOT NULL DEFAULT 'SYSTEM' AFTER comment; + # # TRIGGER privilege # -- cgit v1.2.1 From 0eec6c133a164eb2b0c19f0241054edb4a52825f Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 16 Mar 2007 17:28:32 +0100 Subject: Bug#20166 mysql-test-run.pl does not test system privilege tables creation - Build sql files for netware from the mysql_system_tables*.sq files - Fix comments about mysql_create_system_tables.sh - Use mysql_install_db.sh to create system tables for mysql_test-run-shell - Fix mysql-test-run.pl to also look in share/mysql for the msyql_system*.sql files BitKeeper/deleted/.del-init_db.sql~e2b8d0c8390e8023: Rename: netware/init_db.sql -> BitKeeper/deleted/.del-init_db.sql~e2b8d0c8390e8023 BitKeeper/deleted/.del-test_db.sql: Rename: netware/test_db.sql -> BitKeeper/deleted/.del-test_db.sql BitKeeper/etc/ignore: Added netware/init_db.sql netware/test_db.sql to the ignore list mysql-test/install_test_db.sh: Use mysql_install_db from install_test_db(which is used bu mysql-test-run-shell) to install the system tables mysql-test/mysql-test-run.pl: Look for the mysql_system_tables*.sql also in share/mysql netware/Makefile.am: Build netware/init_db.sql and netware/test_db.sql from the sources in scripts/msyql_system_tables*.sql scripts/make_binary_distribution.sh: netware/init_db.sql and netware/test_db.sql are now built by the Makefiles from the scripts/mysql_system_tables*.sql files sql/mysql_priv.h: Update comment remindging to update the MySQL system table definitions when adding a new SQL_MODE sql/sql_acl.h: Update comment reminding to update the MySQL System tables when changing the ACL defines --- scripts/make_binary_distribution.sh | 6 ------ 1 file changed, 6 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 4e95c51a829..7d7918975f2 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -298,12 +298,6 @@ rm -f $BASE/bin/Makefile* $BASE/bin/*.in $BASE/bin/*.sh \ # Copy system dependent files # if [ $BASE_SYSTEM = "netware" ] ; then - echo "CREATE DATABASE mysql;" > $BASE/bin/init_db.sql - echo "CREATE DATABASE test;" >> $BASE/bin/init_db.sql - sh ./scripts/mysql_create_system_tables.sh real "" "%" 0 \ - >> $BASE/bin/init_db.sql - sh ./scripts/mysql_create_system_tables.sh test "" "%" 0 \ - > $BASE/bin/test_db.sql ./scripts/fill_help_tables < ./Docs/manual.texi >> ./netware/init_db.sql fi -- cgit v1.2.1 From 77fccd038f7b6e177c7dd6d5ff28d0490589598f Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 16 Mar 2007 20:56:16 +0100 Subject: Bug#20166 mysql-test-run.pl does not test system privilege tables creation - Build sql files for netware from the mysql_system_tables*.sq files - Fix comments about mysql_create_system_tables.sh - Use mysql_install_db.sh to create system tables for mysql_test-run-shell - Fix mysql-test-run.pl to also look in share/mysql for the msyql_system*.sql files Changeset coded today by Magnus Svensson, just the application to 5.0.38 is by Joerg Bruehe. BitKeeper/deleted/.del-init_db.sql~e2b8d0c8390e8023: Delete: netware/init_db.sql BitKeeper/deleted/.del-test_db.sql: Delete: netware/test_db.sql BitKeeper/etc/ignore: Added netware/init_db.sql netware/test_db.sql to the ignore list mysql-test/install_test_db.sh: Use mysql_install_db from install_test_db(which is used by mysql-test-run-shell) to install the system tables mysql-test/mysql-test-run.pl: Look for the mysql_system_tables*.sql also in share/mysql netware/Makefile.am: Build netware/init_db.sql and netware/test_db.sql from the sources in scripts/msyql_system_tables*.sql scripts/make_binary_distribution.sh: netware/init_db.sql and netware/test_db.sql are now built by the Makefiles from the scripts/mysql_system_tables*.sql files sql/mysql_priv.h: Update comment remindging to update the MySQL system table definitions when adding a new SQL_MODE sql/sql_acl.h: Update comment reminding to update the MySQL System tables when changing the ACL defines --- scripts/make_binary_distribution.sh | 6 ------ 1 file changed, 6 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 4e95c51a829..7d7918975f2 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -298,12 +298,6 @@ rm -f $BASE/bin/Makefile* $BASE/bin/*.in $BASE/bin/*.sh \ # Copy system dependent files # if [ $BASE_SYSTEM = "netware" ] ; then - echo "CREATE DATABASE mysql;" > $BASE/bin/init_db.sql - echo "CREATE DATABASE test;" >> $BASE/bin/init_db.sql - sh ./scripts/mysql_create_system_tables.sh real "" "%" 0 \ - >> $BASE/bin/init_db.sql - sh ./scripts/mysql_create_system_tables.sh test "" "%" 0 \ - > $BASE/bin/test_db.sql ./scripts/fill_help_tables < ./Docs/manual.texi >> ./netware/init_db.sql fi -- cgit v1.2.1 From 6f4a4d8a7d2b4e422a2e76e9f572fce32550b868 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 18 Mar 2007 10:47:15 +0100 Subject: make_win_bin_dist: - Support both "release" and "relwithdebinfo" targets - Copy ".pdb" and ".pdb" files for the server and instance manager - Removed the examples directory, unsupported - Handle both old and new builds in the same script, "-debug" and "-nt" extensions, directory "data" and "share" in different location scripts/make_win_bin_dist: - Support both "release" and "relwithdebinfo" targets - Copy ".pdb" and ".pdb" files for the server and instance manager - Removed the examples directory, unsupported - Handle both old and new builds in the same script, "-debug" and "-nt" extensions, directory "data" and "share" in different location --- scripts/make_win_bin_dist | 88 +++++++++++++++++++++++++++++------------------ 1 file changed, 54 insertions(+), 34 deletions(-) (limited to 'scripts') diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index 9e2df23fe51..b1ef199375f 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -126,11 +126,20 @@ if [ -e $DESTDIR ] ; then usage fi +trap 'echo "Clearning up and exiting..." ; rm -fr $DESTDIR; exit 1' ERR + # ---------------------------------------------------------------------- -# Copy executables, and client DLL (FIXME why?) +# Adjust target name if needed, release with debug info has another name # ---------------------------------------------------------------------- -trap 'echo "Clearning up and exiting..." ; rm -fr $DESTDIR; exit 1' ERR +if [ x"$TARGET" = x"release" -a "client/relwithdebinfo/mysql.exe" ] +then + TARGET="relwithdebinfo" +fi + +# ---------------------------------------------------------------------- +# Copy executables, and client DLL +# ---------------------------------------------------------------------- mkdir $DESTDIR mkdir $DESTDIR/bin @@ -138,20 +147,36 @@ cp client/$TARGET/*.exe $DESTDIR/bin/ cp extra/$TARGET/*.exe $DESTDIR/bin/ cp myisam/$TARGET/*.exe $DESTDIR/bin/ cp server-tools/instance-manager/$TARGET/*.exe $DESTDIR/bin/ +cp server-tools/instance-manager/$TARGET/*.pdb $DESTDIR/bin/ || true +cp server-tools/instance-manager/$TARGET/*.map $DESTDIR/bin/ || true cp tests/$TARGET/*.exe $DESTDIR/bin/ -cp libmysql/$TARGET/*.exe $DESTDIR/bin/ cp libmysql/$TARGET/libmysql.dll $DESTDIR/bin/ # FIXME really needed?! mv $DESTDIR/bin/comp_err.exe $DESTDIR/bin/comp-err.exe -cp sql/$TARGET/mysqld.exe $DESTDIR/bin/mysqld$EXE_SUFFIX.exe +if [ -f "sql/$TARGET/mysqld-nt.exe" ] ; then + BASENAME="mysqld-nt" # Old style non CMake build +else + BASENAME="mysqld" # New style CMake build +fi + +# Depending on Visual Studio target, the optimized server has symbols +cp sql/$TARGET/$BASENAME.exe $DESTDIR/bin/$BASENAME$EXE_SUFFIX.exe +cp sql/$TARGET/$BASENAME.pdb $DESTDIR/bin/$BASENAME$EXE_SUFFIX.pdb || true +cp sql/$TARGET/$BASENAME.map $DESTDIR/bin/$BASENAME$EXE_SUFFIX.map || true + +if [ -f "sql/debug/mysqld-debug.exe" ] ; then + BASENAME="mysqld-debug" # Old style non CMake build +else + BASENAME="mysqld" # New style CMake build +fi -if [ x"$PACK_DEBUG" = "" -a -f "sql/debug/mysqld.exe" -o \ +if [ x"$PACK_DEBUG" = "" -a -f "sql/debug/$BASENAME.exe" -o \ x"$PACK_DEBUG" = "yes" ] ; then - cp sql/debug/mysqld.exe $DESTDIR/bin/mysqld-debug.exe - cp sql/debug/mysqld.pdb $DESTDIR/bin/mysqld-debug.pdb - cp sql/debug/mysqld.map $DESTDIR/bin/mysqld-debug.map + cp sql/debug/$BASENAME.exe $DESTDIR/bin/mysqld-debug.exe + cp sql/debug/$BASENAME.pdb $DESTDIR/bin/mysqld-debug.pdb + cp sql/debug/$BASENAME.map $DESTDIR/bin/mysqld-debug.map || true fi # ---------------------------------------------------------------------- @@ -160,7 +185,9 @@ fi # FIXME is there ever a data directory to copy? if [ -d win/data ] ; then - cp -pR win/data $DESTDIR/data + cp -pR win/data $DESTDIR/ +elif [ -d data ] ; then + cp -pR data $DESTDIR/ fi # FIXME maybe a flag to define "release build", or do the @@ -210,27 +237,6 @@ if [ x"$PACK_EMBEDDED" = "" -a \ copy_embedded fi -# ---------------------------------------------------------------------- -# FIXME test stuff that is useless garbage? -# ---------------------------------------------------------------------- - -mkdir -p $DESTDIR/examples/libmysqltest/release -cp libmysql/mytest.c libmysql/myTest.vcproj libmysql/$TARGET/myTest.exe \ - $DESTDIR/examples/libmysqltest/ -cp libmysql/$TARGET/myTest.exe $DESTDIR/examples/libmysqltest/release/ - -if [ x"$PACK_DEBUG" = "" -a -f "libmysql/debug/myTest.exe" -o \ - x"$PACK_DEBUG" = "yes" ] ; then - mkdir -p $DESTDIR/examples/libmysqltest/debug - cp libmysql/debug/myTest.exe $DESTDIR/examples/libmysqltest/debug/ -fi - -mkdir -p $DESTDIR/examples/tests -cp tests/*.res tests/*.tst tests/*.pl tests/*.c $DESTDIR/examples/tests/ - -mkdir -p $DESTDIR/examples/udf_example -cp sql/udf_example.def sql/udf_example.vcproj sql/udf_example.c $DESTDIR/examples/udf_example/ - # ---------------------------------------------------------------------- # FIXME why not copy it all in "include"?! # ---------------------------------------------------------------------- @@ -271,14 +277,23 @@ if [ x"$PACK_DEBUG" = "" -a -f "libmysql/debug/libmysql.lib" -o \ cp libmysql/debug/libmysql.dll \ libmysql/debug/libmysql.lib \ client/debug/mysqlclient.lib \ - mysys/debug/mysys.lib \ regex/debug/regex.lib \ strings/debug/strings.lib \ zlib/debug/zlib.lib $DESTDIR/lib/debug/ + + if [ -f "mysys/debug/mysys-nt.lib" ] ; then + cp mysys/debug/mysys-nt.lib $DESTDIR/lib/debug/ + else + cp mysys/debug/mysys.lib $DESTDIR/lib/debug/mysys-nt.lib + fi + fi -# FIXME sort this out... -cp mysys/$TARGET/mysys.lib $DESTDIR/lib/opt/mysys_tls.lib +if [ -f "mysys/$TARGET/mysys-nt.lib" ] ; then + cp mysys/$TARGET/mysys-nt.lib $DESTDIR/lib/opt/ +else + cp mysys/$TARGET/mysys.lib $DESTDIR/lib/opt/mysys-nt.lib +fi # ---------------------------------------------------------------------- # Copy the test directory @@ -292,6 +307,7 @@ cp mysql-test/README $DESTDIR/mysql-test/ cp mysql-test/install_test_db.sh $DESTDIR/mysql-test/install_test_db cp mysql-test/include/*.inc $DESTDIR/mysql-test/include/ cp mysql-test/lib/*.pl $DESTDIR/mysql-test/lib/ +cp mysql-test/lib/*.sql $DESTDIR/mysql-test/lib/ || true cp mysql-test/r/*.require $DESTDIR/mysql-test/r/ # Need this trick, or we get "argument list too long". ABS_DST=`pwd`/$DESTDIR @@ -335,7 +351,11 @@ for i in `cd scripts && ls`; do \ fi; \ done -cp -pR sql/share $DESTDIR/ +if [ -d "share" ] ; then + cp -pR share $DESTDIR/ +else + cp -pR sql/share $DESTDIR/ +fi cp -pR sql-bench $DESTDIR/ rm -f $DESTDIR/sql-bench/*.sh $DESTDIR/sql-bench/Makefile* -- cgit v1.2.1 From 3ff229b41817aa8b99c7112d1f54adf5abbeace5 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 19 Mar 2007 16:18:10 +0100 Subject: Many files: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/bdb/bdb.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/client/mysql.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/client/mysql_upgrade.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/client/mysqladmin.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/client/mysqlclient.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/client/mysqldump.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/client/mysqlimport.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/client/mysqlshow.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/client/mysqltest.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/comp_err/comp_err.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/dbug/dbug.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/heap/heap.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/innobase/innobase.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/libmysql/libmysql.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/libmysqld/examples/test_libmysqld.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/libmysqld/libmysqld.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/libmysqltest/myTest.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/my_print_defaults/my_print_defaults.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/myisam/myisam.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/myisam_ftdump/myisam_ftdump.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/myisamchk/myisamchk.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/myisamlog/myisamlog.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/myisammrg/myisammrg.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/myisampack/myisampack.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/mysql.sln: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/mysqlbinlog/mysqlbinlog.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/mysqlcheck/mysqlcheck.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/mysqldemb/mysqldemb.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/mysqlserver/mysqlserver.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/mysys/mysys.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/perror/perror.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/regex/regex.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/replace/replace.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/sql/gen_lex_hash.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/sql/mysqld.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/strings/strings.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/test1/test1.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/tests/mysql_client_test.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/thr_test/thr_test.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/vio/vio.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/zlib/zlib.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc extra/yassl/taocrypt/taocrypt.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc extra/yassl/yassl.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc ndb/src/cw/cpcc-win32/C++/CPC_GUI.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc scripts/make_win_bin_dist: Major cleanup of old Visual Studio project files, aligning engines etc server-tools/instance-manager/mysqlmanager.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc --- scripts/make_win_bin_dist | 1 - 1 file changed, 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index a674fe08362..b1ef199375f 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -306,7 +306,6 @@ cp mysql-test/mysql-test-run.pl $DESTDIR/mysql-test/ cp mysql-test/README $DESTDIR/mysql-test/ cp mysql-test/install_test_db.sh $DESTDIR/mysql-test/install_test_db cp mysql-test/include/*.inc $DESTDIR/mysql-test/include/ -cp mysql-test/include/*.test $DESTDIR/mysql-test/include/ cp mysql-test/lib/*.pl $DESTDIR/mysql-test/lib/ cp mysql-test/lib/*.sql $DESTDIR/mysql-test/lib/ || true cp mysql-test/r/*.require $DESTDIR/mysql-test/r/ -- cgit v1.2.1 From f5e1dad7d0922ad2305eeff119c33bba2b0c252c Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 19 Mar 2007 16:45:37 +0100 Subject: make_win_bin_dist: Restore accidently removed line scripts/make_win_bin_dist: Restore accidently removed line --- scripts/make_win_bin_dist | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index b1ef199375f..a674fe08362 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -306,6 +306,7 @@ cp mysql-test/mysql-test-run.pl $DESTDIR/mysql-test/ cp mysql-test/README $DESTDIR/mysql-test/ cp mysql-test/install_test_db.sh $DESTDIR/mysql-test/install_test_db cp mysql-test/include/*.inc $DESTDIR/mysql-test/include/ +cp mysql-test/include/*.test $DESTDIR/mysql-test/include/ cp mysql-test/lib/*.pl $DESTDIR/mysql-test/lib/ cp mysql-test/lib/*.sql $DESTDIR/mysql-test/lib/ || true cp mysql-test/r/*.require $DESTDIR/mysql-test/r/ -- cgit v1.2.1 From 46d02a2c01e2a102e827f9c9491b3447ed4d76bc Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 19 Mar 2007 22:41:16 +0100 Subject: mysys.vcproj: Removed accidently added my_winsem.c make_win_bin_dist: Corrected test for relwithdebinfo target mysql.sln: Specify that comp_err depends on zlib VC++Files/mysys/mysys.vcproj: Removed accidently added my_winsem.c VC++Files/mysql.sln: Specify that comp_err depends on zlib scripts/make_win_bin_dist: Corrected test for relwithdebinfo target --- scripts/make_win_bin_dist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index a674fe08362..59018195ef2 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -132,7 +132,7 @@ trap 'echo "Clearning up and exiting..." ; rm -fr $DESTDIR; exit 1' ERR # Adjust target name if needed, release with debug info has another name # ---------------------------------------------------------------------- -if [ x"$TARGET" = x"release" -a "client/relwithdebinfo/mysql.exe" ] +if [ x"$TARGET" = x"release" -a -f "client/relwithdebinfo/mysql.exe" ] then TARGET="relwithdebinfo" fi -- cgit v1.2.1 From e1d8f329fa474e8b7a2610f45723da2ec2c07e0c Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 20 Mar 2007 15:12:50 +0100 Subject: vio.vcproj, mysqld.vcproj, mysys.vcproj, libmysqld.vcproj, mysqldemb.vcproj: No need to set LICENSE or USE_SYMDIR from project files make_win_bin_dist: Changed location of SQL initialization files to be "share/" scripts/make_win_bin_dist: Changed location of SQL initialization files to be "share/" VC++Files/libmysqld/libmysqld.vcproj: No need to set LICENSE or USE_SYMDIR from project files VC++Files/mysqldemb/mysqldemb.vcproj: No need to set LICENSE or USE_SYMDIR from project files VC++Files/mysys/mysys.vcproj: No need to set LICENSE or USE_SYMDIR from project files VC++Files/sql/mysqld.vcproj: No need to set LICENSE or USE_SYMDIR from project files VC++Files/vio/vio.vcproj: No need to set LICENSE or USE_SYMDIR from project files --- scripts/make_win_bin_dist | 3 +++ 1 file changed, 3 insertions(+) (limited to 'scripts') diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index 59018195ef2..5d4c7ab917d 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -360,6 +360,9 @@ fi cp -pR sql-bench $DESTDIR/ rm -f $DESTDIR/sql-bench/*.sh $DESTDIR/sql-bench/Makefile* +# The SQL initiation code is really expected to be in "share" +mv $DESTDIR/scripts/*.sql $DESTDIR/share/ || true + # ---------------------------------------------------------------------- # Copy other files specified on command line DEST=SOURCE # ---------------------------------------------------------------------- -- cgit v1.2.1 From 33a51fd8436cc418df0e1ce5ee0f12da6f8ab16b Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 21 Mar 2007 19:20:44 +0300 Subject: Fix a broken merge. scripts/mysql_system_tables.sql: Add time_zone to the list of mysql.event columns. scripts/mysql_system_tables_fix.sql: Update after a bad merge: now mysql_system_tables_fix contains only alter definitions, no CREATE definitions (single definition source approach that was implemented by Magnus). --- scripts/mysql_system_tables.sql | 2 +- scripts/mysql_system_tables_fix.sql | 70 +++---------------------------------- 2 files changed, 6 insertions(+), 66 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql index 7be5c94ad80..f6e2a45339e 100644 --- a/scripts/mysql_system_tables.sql +++ b/scripts/mysql_system_tables.sql @@ -70,7 +70,7 @@ CALL create_slow_log_table(); DROP PROCEDURE create_slow_log_table; -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') 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') DEFAULT '' NOT NULL, comment char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', 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') 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') DEFAULT '' NOT NULL, comment char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', time_zone char(64) CHARACTER SET latin1 NOT NULL DEFAULT 'SYSTEM', 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_fix.sql b/scripts/mysql_system_tables_fix.sql index 57f97256b39..d973c1dddae 100644 --- a/scripts/mysql_system_tables_fix.sql +++ b/scripts/mysql_system_tables_fix.sql @@ -424,83 +424,24 @@ END// delimiter ; CALL create_log_tables(); DROP PROCEDURE create_log_tables; -# -# EVENT table -# - - -CREATE TABLE 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') 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' - ) DEFAULT '' NOT NULL, - comment char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', - time_zone char(64) CHARACTER SET latin1 NOT NULL DEFAULT 'SYSTEM', - PRIMARY KEY (db,name) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT 'Events'; - # # EVENT privilege # - SET @hadEventPriv := 0; SELECT @hadEventPriv :=1 FROM user WHERE Event_priv LIKE '%'; ALTER TABLE user add Event_priv enum('N','Y') character set utf8 DEFAULT 'N' NOT NULL AFTER Create_user_priv; ALTER TABLE user MODIFY Event_priv enum('N','Y') character set utf8 DEFAULT 'N' NOT NULL AFTER Create_user_priv; +UPDATE user SET Event_priv=Super_priv WHERE @hadEventPriv = 0; + ALTER TABLE db add Event_priv enum('N','Y') character set utf8 DEFAULT 'N' NOT NULL; ALTER TABLE db MODIFY Event_priv enum('N','Y') character set utf8 DEFAULT 'N' NOT NULL; +# +# EVENT table +# ALTER TABLE event DROP PRIMARY KEY; ALTER TABLE event ADD PRIMARY KEY(db, name); ALTER TABLE event ADD sql_mode @@ -535,7 +476,6 @@ ALTER TABLE event ADD sql_mode 'NO_AUTO_CREATE_USER', 'HIGH_NOT_PRECEDENCE' ) DEFAULT '' NOT NULL AFTER on_completion; -UPDATE user SET Event_priv=Super_priv WHERE @hadEventPriv = 0; ALTER TABLE event MODIFY name char(64) CHARACTER SET utf8 NOT NULL default ''; ALTER TABLE event ADD COLUMN time_zone char(64) CHARACTER SET latin1 -- cgit v1.2.1 From 4b4700f32f88f58c9b7f3d30ef600b292c87693b Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Mar 2007 19:43:15 +0100 Subject: .del-fill_func_tables.sh: Delete: scripts/fill_func_tables.sh .del-fill_help_tables.sh: Delete: scripts/fill_help_tables.sh .del-internals.texi: Delete: Docs/internals.texi BitKeeper/deleted/.del-internals.texi: Delete: Docs/internals.texi BitKeeper/deleted/.del-fill_func_tables.sh: Delete: scripts/fill_func_tables.sh BitKeeper/deleted/.del-fill_help_tables.sh: Delete: scripts/fill_help_tables.sh --- scripts/fill_func_tables.sh | 239 ------------------ scripts/fill_help_tables.sh | 603 -------------------------------------------- 2 files changed, 842 deletions(-) delete mode 100644 scripts/fill_func_tables.sh delete mode 100644 scripts/fill_help_tables.sh (limited to 'scripts') diff --git a/scripts/fill_func_tables.sh b/scripts/fill_func_tables.sh deleted file mode 100644 index b7bd3736392..00000000000 --- a/scripts/fill_func_tables.sh +++ /dev/null @@ -1,239 +0,0 @@ -#!@PERL@ -# -# Copyright (C) 2003 MySQL AB -# For a more info consult the file COPYRIGHT distributed with this file. -# -# fill_func_tables - parse ../Docs/manual.texi -# -# Original version by Victor Vagin -# - -my $cat_name= ""; -my $func_name= ""; -my $text= ""; -my $example= ""; - -local $mode= ""; - -sub prepare_name -{ - my ($a)= @_; - - $a =~ s/(\@itemize \@bullet)/ /g; - $a =~ s/(\@end itemize)/ /g; - $a =~ s/(\@end multitable)/ /g; - $a =~ s/(\@end table)/ /g; - $a =~ s/(\@cindex(.*?)\n)/ /g; - $a =~ s/(\@multitable \@columnfractions(.*?)\n)/ /g; - $a =~ s/(\@node(.*?)\n)/ /g; - $a =~ s/(\@tab)/\t/g; - $a =~ s/\@item/ /g; - $a =~ s/\@code\{((.|\n)+?)\}/$1/go; - $a =~ s/\@strong\{(.+?)\}/$1/go; - $a =~ s/\@samp\{(.+?)\}/$1/go; - $a =~ s/\@emph\{((.|\n)+?)\}/\/$1\//go; - $a =~ s/\@xref\{((.|\n)+?)\}/See also : [$1]/go; - $a =~ s/\@ref\{((.|\n)+?)\}/[$1]/go; - $a =~ s/\'/\'\'/g; - $a =~ s/\\/\\\\/g; - $a =~ s/\`/\`\`/g; - - $a =~ s/\@table \@code/ /g; - - $a =~ s/\(\)//g; - - $a =~ s/((\w|\s)+)\(([\+-=><\/%*!<>\s]+)\)/$3/gxs; #$a =~ s/((\w|\s)+)\(([\+-=><\/%*!<>\s]+)\)/$3 $1/gxs; - $a =~ s/([\+-=><\/%*!<>\s]+)\(((\w|\s)+)\)/$1/gxs;#$a =~ s/([\+-=><\/%*!<>\s]+)\(((\w|\s)+)\)/$1 $2/gxs; - $a =~ s/((\w|\s)+)\((.+)\)/$1/gxs; - - return $a; -} - -sub prepare_text -{ - my ($a)= @_; - - $a =~ s/(\@itemize \@bullet)/ /g; - $a =~ s/(\@end itemize)/ /g; - $a =~ s/(\@end multitable)/ /g; - $a =~ s/(\@end table)/ /g; - $a =~ s/(\@cindex(.*?)\n)/ /g; - $a =~ s/(\@multitable \@columnfractions(.*?)\n)/ /g; - $a =~ s/(\@node(.*?)\n)/ /g; - $a =~ s/(\@tab)/\t/g; - $a =~ s/\@itemx/ /g; - $a =~ s/\@item/ /g; - $a =~ s/\@code\{((.|\n)+?)\}/$1/go; - $a =~ s/\@strong\{(.+?)\}/$1/go; - $a =~ s/\@samp\{(.+?)\}/$1/go; - $a =~ s/\@emph\{((.|\n)+?)\}/\/$1\//go; - $a =~ s/\@xref\{((.|\n)+?)\}/See also : [$1]/go; - $a =~ s/\@ref\{((.|\n)+?)\}/[$1]/go; - $a =~ s/\'/\'\'/g; - $a =~ s/\\/\\\\/g; - $a =~ s/\`/\`\`/g; - $a =~ s/(\n*?)$//g; - $a =~ s/\n/\\n/g; - - $a =~ s/\@table \@code/ /g; - - return $a; -} - -sub prepare_example -{ - my ($a)= @_; - - $a =~ s/\'/\'\'/g; - $a =~ s/\\/\\\\/g; - $a =~ s/\`/\`\`/g; - $a =~ s/(\n*?)$//g; - $a =~ s/\n/\\n/g; - - return $a; -} - -sub flush_all -{ - my ($mode) = @_; - - if ($mode eq ""){return;} - - $func_name= prepare_name($func_name); - $text= prepare_text($text); - $example= prepare_example($example); - - if ($func_name ne "" && $text ne "" && !($func_name =~ /[abcdefghikjlmnopqrstuvwxyz]/)){ - print "INSERT INTO function (name,description,example) VALUES ("; - print "'$func_name',"; - print "'$text',"; - print "'$example'"; - print ");\n"; - print "INSERT INTO function_category (cat_id,func_id) VALUES (\@cur_category,LAST_INSERT_ID());\n"; - } - - $func_name= ""; - $text= ""; - $example= ""; - $mode= ""; -} - -sub new_category -{ - my ($category)= @_; - - $category= prepare_text($category); - - print "INSERT INTO function_category_name (name) VALUES (\'$category\');\n"; - print "SELECT \@cur_category:=LAST_INSERT_ID();\n"; -} - -print "INSERT INTO db (Host,DB,User,Select_priv) VALUES ('%','mysql_help','','Y');\n"; -print "CREATE DATABASE mysql_help;\n"; - -print "USE mysql_help;\n"; - -print "DROP TABLE IF EXISTS function;\n"; -print "CREATE TABLE function ("; -print " func_id int unsigned not null auto_increment,"; -print " name varchar(64) not null,"; -print " url varchar(128) not null,"; -print " description text not null,"; -print " example text not null,"; -print " min_args tinyint not null,"; -print " max_args tinyint,"; -print " date_created datetime not null,"; -print " last_modified timestamp not null,"; -print " primary key (func_id)"; -print ") type=myisam;\n\n"; - -print "DROP TABLE IF EXISTS function_category_name;\n"; -print "CREATE TABLE function_category_name ("; -print " cat_id smallint unsigned not null auto_increment,"; -print " name varchar(64) not null,"; -print " url varchar(128) not null,"; -print " date_created datetime not null,"; -print " last_modified timestamp not null,"; -print " primary key (cat_id)"; -print ") type=myisam;\n\n"; - -print "DROP TABLE IF EXISTS function_category;\n"; -print "CREATE TABLE function_category ("; -print " cat_id smallint unsigned not null references function_category_name,"; -print " func_id int unsigned not null references function,"; -print " primary key (cat_id, func_id)"; -print ") type=myisam;\n\n"; - -print "DELETE FROM function_category_name;\n"; -print "DELETE FROM function_category;\n"; -print "DELETE FROM function;\n"; -print "SELECT \@cur_category:=null;\n\n"; - -my $in_section_6_3= 0; - -for(<>) -{ - if ($_=~/\@section Functions for Use in \@code{SELECT} and \@code{WHERE} Clauses/ && - !$in_section_6_3){ - $in_section_6_3= 1; - next; - } - - if ($_=~/\@section/ && $in_section_6_3){ - $in_section_6_3= 0; - next; - } - - if (!$in_section_6_3) { next; } - - my $c_name= ""; - - ($c_name)=m|\@c for_mysql_help,(.+?)$|; - if (!($c_name eq "") && ! ($c_name =~ m/$cat_name/i)){ - ($cat_name)= $c_name; - new_category($cat_name); - next; - } - - ($c_name)=m|\@subsubsection (.+?)$|; - if (!($c_name eq "") && ! ($c_name =~ m/$cat_name/i)){ - ($cat_name)= $c_name; - new_category($cat_name); - next; - } - - ($c_name)=m|\@subsection (.+?)$|; - if (!($c_name eq "") && ! ($c_name =~ m/$cat_name/i)){ - ($cat_name)= $c_name; - new_category($cat_name); - next; - } - - ($f_name)=m|\@findex (.+?)$|; - if (!($f_name eq "")){ - flush_all($mode); - ($func_name)= ($f_name); - $mode= "text"; - next; - } - - if ($_=~/\@example/ && ($mode eq "text")){ - $mode= "example"; - next; - } - - if ($_=~/\@end example/ && ($mode eq "example")){ - flush_all($mode); - next; - } - - if ($mode eq "text") { $text .= $_; } - if ($mode eq "example") { $example .= $_; } -} - - -print "DELETE function_category_name "; -print "FROM function_category_name "; -print "LEFT JOIN function_category ON function_category.cat_id=function_category_name.cat_id "; -print "WHERE function_category.cat_id is null;" - diff --git a/scripts/fill_help_tables.sh b/scripts/fill_help_tables.sh deleted file mode 100644 index fc0c684c2dc..00000000000 --- a/scripts/fill_help_tables.sh +++ /dev/null @@ -1,603 +0,0 @@ -#!@PERL@ -# -# Copyright (C) 2003 MySQL AB -# For a more info consult the file COPYRIGHT distributed with this file. -# -# This script generates the SQL statements required by mysql_install_db to -# fill up the tables for the server-side online function help, which can be -# invoked with "help " from the MySQL client. -# -# Usage: -# fill_help_tables OPTIONS < manual.texi > fill_help_tables.sql -# -# --help display this helpscreen and exit -# --verbose print information about help completeness to STDERR -# --lexems=path path to file with lexems. it is used with verbose option. -# default value is ../sql/lex.h -# Examples: -# ./fill_help_tables --help -# ./fill_help_tables --verbose < manual.texi > fill_help_tables.sql -# ./fill_help_tables < manual.texi > fill_help_tables.sql -# -# Please note, that you first need to update Docs/manual.texi with the -# manual file from the separate "mysqldoc" BitKeeper-Tree! The manual.texi -# included in the source tree is just an empty stub file - the full manual -# is now maintained in a separate tree. -# -# extra tags in manual.texi: -# -# @c help_category [@] -# -# @c description_for_help_topic -# .... -# @c end_description_for_help_topic -# -# @c example_for_help_topic -# @example -# .... -# @end example -# -# -# Original version by Victor Vagin -# - -use strict; -use Getopt::Long; - -my $insert_portion_size= 15; -my $error_prefix= "---- help parsing errors :"; - -my $path_to_lex_file= "../sql/lex.h"; -my $verbose_option= 0; -my $help_option= 0; - -my $cur_line= 0; -my $count_errors= 0; - -GetOptions( - "help",\$help_option, - "verbose",\$verbose_option, - "lexems=s",\$path_to_lex_file -); - -if ($help_option ne 0) -{ - print <<_HELP; - -This script generates the SQL statements required by mysql_install_db to -fill up the tables for the server-side online function help, which can be -invoked with "help " from the MySQL client. - -Usage: - fill_help_tables OPTIONS < manual.texi > fill_help_tables.sql - - --help display this helpscreen and exit - --verbose print information about help completeness to STDERR - --lexems=path path to file with lexems. it is used with verbose option. - default value is ../sql/lex.h - -Examples: - ./fill_help_tables --help - ./fill_help_tables --verbose < manual.texi > fill_help_tables.sql - ./fill_help_tables < manual.texi > fill_help_tables.sql - -_HELP - exit; -} - -my $current_category= ""; -my $current_parent_category= ""; -my $next_example_for_topic= ""; - -my %topics; -my %categories; -my %keywords; - -$categories{Contents}->{__parent_category__}= ""; - -sub print_error -{ - my ($text)= @_; - if ($count_errors==0) - { - print STDERR "$error_prefix\n"; - } - print STDERR "line $cur_line : $text"; - $count_errors++; -} - -sub add_topic_to_category -{ - my ($topic_name)= @_; - - $categories{$current_category}->{$topic_name}= $topics{$topic_name}; - my $category= $categories{$current_category}; - $category->{__name__}= $current_category; - - if (exists($category->{__parent_category__})) - { - my $old_parent= $category->{__parent_category__}; - if ($old_parent ne $current_parent_category) - { - print_error "wrong parent for $current_category\n"; - } - } - - if ($current_parent_category ne "") - { - $category->{__parent_category__}= $current_parent_category; - } - - if (exists($topics{$topic_name}->{category})) - { - my $old_category= $topics{$topic_name}->{category}; - if ($old_category ne $category) - { - print_error "wrong category for $topic_name (first one's \"$old_category->{__name__}\" second one's \"$current_category\")\n"; - } - } - - $topics{$topic_name}->{category}= $category; -} - -sub add_example -{ - my ($topic_name,$example)= @_; - - $topic_name=~ tr/a-z/A-Z/; - - if (exists($topics{$topic_name}->{example})) - { - print_error "double example for $topic_name\n"; - } - - $topics{$topic_name}->{example}= $example; - add_topic_to_category($topic_name); -} - -sub add_description -{ - my ($topic_name,$description)= @_; - - $topic_name=~ tr/a-z/A-Z/; - - if (exists($topics{$topic_name}->{description})) - { - print_error "double description for $topic_name\n"; - } - $topics{$topic_name}->{description}= $description; - add_topic_to_category($topic_name); -} - -sub add_keyword -{ - my ($topic_name,$keyword)= @_; - - $topic_name=~ tr/a-z/A-Z/; - $keyword=~ tr/a-z/A-Z/; - - push(@{$topics{$topic_name}->{keywords}},$keyword); - if (exists($keywords{$keyword}->{$topic_name})) - { - print_error "double keyword $keyword for $topic_name\n"; - } - $keywords{$keyword}->{$topic_name}= $topics{$topic_name}; -} - -sub prepare_name -{ - my ($a)= @_; - - $a =~ s/(\@itemize \@bullet)/ /g; - $a =~ s/(\@end itemize)/ /g; - $a =~ s/(\@end multitable)/ /g; - $a =~ s/(\@end table)/ /g; - $a =~ s/(\@cindex(.*?)\n)/ /g; - $a =~ s/(\@multitable \@columnfractions(.*?)\n)/ /g; - $a =~ s/(\@node(.*?)\n)/ /g; - $a =~ s/(\@tab)/\t/g; - $a =~ s/\@item/ /g; - $a =~ s/\@minus\{\}/-/g; - $a =~ s/\@dots\{\}/.../g; - $a =~ s/\@var\{((.|\n)+?)\}/$1/go; - $a =~ s/\@command\{((.|\n)+?)\}/$1/go; - $a =~ s/\@code\{((.|\n)+?)\}/$1/go; - $a =~ s/\@strong\{(.+?)\}/$1/go; - $a =~ s/\@samp\{(.+?)\}/'$1'/go; - $a =~ s/\@emph\{((.|\n)+?)\}/\/$1\//go; - $a =~ s/\@xref\{((.|\n)+?)\}/See also : [$1]/go; - $a =~ s/\@ref\{((.|\n)+?)\}/[$1]/go; - $a =~ s/\'/\'\'/g; - $a =~ s/\\/\\\\/g; - $a =~ s/\`/\`\`/g; - - $a =~ s/\@table \@code/ /g; - $a =~ s/\(\)//g; - $a =~ s/\"/\\\"/g; - - $a =~ s/((\w|\s)+)\(([\+-=><\/%*!<>\s]+)\)/$3/gxs; - $a =~ s/([\+-=><\/%*!<>\s]+)\(((\w|\s)+)\)/$1/gxs; - $a =~ s/((\w|\s)+)\((.+)\)/$1/gxs; - - $a =~ s/((\s)+)$//g; - - return $a; -} - -sub prepare_description -{ - my ($a)= @_; - - $a =~ s/(\@itemize \@bullet\n)//g; - $a =~ s/(\@c help_keyword (.*?)\n)//g; - $a =~ s/(\@end itemize\n)//g; - $a =~ s/(\@end example\n)//g; - $a =~ s/(\@example\n)//g; - $a =~ s/(\@{)/{/g; - $a =~ s/(\@})/}/g; - $a =~ s/(\@end multitable)/ /g; - $a =~ s/(\@end table)/ /g; - $a =~ s/(\@cindex(.*?)\n)//g; - $a =~ s/(\@findex(.*?)\n)//g; - $a =~ s/(\@table(.*?)\n)//g; - $a =~ s/(\@multitable \@columnfractions(.*?)\n)/ /g; - $a =~ s/(\@node(.*?)\n)/ /g; - $a =~ s/(\@tab)/\t/g; - $a =~ s/\@itemx/ /g; - $a =~ s/(\@item\n(\s*?))(\S)/ --- $3/g; - $a =~ s/(\@item)/ /g; - $a =~ s/(\@tindex\s(.*?)\n)//g; - $a =~ s/(\@c\s(.*?)\n)//g; - $a =~ s/\@minus\{\}/-/g; - $a =~ s/\@dots\{\}/.../g; - $a =~ s/\@var\{((.|\n)+?)\}/$1/go; - $a =~ s/\@command\{((.|\n)+?)\}/$1/go; - $a =~ s/\@code\{((.|\n)+?)\}/$1/go; - $a =~ s/\@strong\{(.+?)\}/$1/go; - $a =~ s/\@samp\{(.+?)\}/'$1'/go; - $a =~ s/\@emph\{((.|\n)+?)\}/\/$1\//go; - $a =~ s/\@xref\{((.|\n)+?)\}/See also : [$1]/go; - $a =~ s/\@ref\{((.|\n)+?)\}/[$1]/go; - $a =~ s/\@w\{((.|\n)+?)\}/$1/go; - $a =~ s/\@strong\{((.|\n)+?)\}/\n!!!!\n$1\n!!!!\n/go; - $a =~ s/\@file\{((.|\n)+?)\}/\*$1/go; - $a =~ s/\\/\\\\/g; - $a =~ s/\n\n$/\n/g; - $a =~ s/\n\n$/\n/g; - $a =~ s/\n\n$/\n/g; - $a =~ s/\n\n$/\n/g; - $a =~ s/\n\n$/\n/g; - $a =~ s/\n/\\n/g; - $a =~ s/\"/\\\"/g; - - $a =~ s/\@table \@code/ /g; - - return $a; -} - -sub prepare_example -{ - my ($a)= @_; - - $a =~ s/(^\@c for_help_topic(.*?)\n)//g; - - $a =~ s/\@var\{((.|\n)+?)\}/$1/go; - $a =~ s/\@dots\{\}/.../g; - $a =~ s/\\/\\\\/g; - $a =~ s/(\@{)/{/g; - $a =~ s/(\@})/}/g; - $a =~ s/(\@\@)/\@/g; - $a =~ s/(\n*?)$//g; - $a =~ s/\n/\\n/g; - $a =~ s/\"/\\\"/g; - - return $a; -} - -sub parse_example -{ - return if (!($_=~/\@example/)); - return if ($next_example_for_topic eq ""); - - my $topic_name= $next_example_for_topic; - $next_example_for_topic= ""; - my $text= ""; - - while (<>) - { - $cur_line++; - last if ($_=~/\@end example/); - $text .= $_; - } - - $text= prepare_example($text); - $topic_name= prepare_name($topic_name); - add_example($topic_name,$text) if ($topic_name ne ""); -} - -sub parse_example_for_topic -{ - my ($for_topic)= m|\@c example_for_help_topic (.+?)$|; - return if ($for_topic eq ""); - - $next_example_for_topic= $for_topic; -} - -sub parse_description -{ - my ($topic_description)= m|\@c description_for_help_topic (.+?)$|; - return if ($topic_description eq ""); - - my ($topic_name,$topic_keywords)= split(/ /,$topic_description); - - if ($topic_name eq "" || $topic_keywords eq "") - { - $topic_name= $topic_description; - } - else - { - my $keyword; - foreach $keyword (split(/ /,$topic_keywords)) - { - add_keyword($topic_name,$keyword) if ($keyword ne ""); - } - } - - my $text= ""; - - while (<>) - { - $cur_line++; - last if ($_=~/\@c end_description_for_help_topic/); - $text .= $_; - } - - $text= prepare_description($text); - $topic_name= prepare_name($topic_name); - add_description($topic_name,$text); -} - -sub parse_category -{ - my ($c_name,$pc_name)= m|\@c help_category (.+?)\@(.+?)$|; - - if ($pc_name ne "") - { - $current_category= prepare_name($c_name); - $current_parent_category= prepare_name($pc_name); - } - else - { - my ($c_name)=m|\@c help_category (.+?)$|; - return if ($c_name eq ""); - - $current_category= prepare_name($c_name); - $current_parent_category= "Contents" - } -} - -# parse manual: - -while (<>) -{ - parse_example_for_topic (); - parse_example (); - parse_description (); - parse_category (); - $cur_line++; -} - -# test results of parsing: - -sub print_bad_names -{ - my($names,$prompt)= @_; - if (scalar(@{$names})) - { - print STDERR "\n-------------- $prompt : \n\n"; - my $name; - foreach $name (@{$names}) - { - print STDERR "$name\n"; - } - print STDERR "\n"; - } -} - -sub print_verbose_errors -{ - my($name_of_log_file)= @_; - - my @without_help; - my @description_with_at; - my @example_with_at; - my @without_description; - my @without_example; - - print STDERR "\n-------------- parameters of help completeness : \n\n"; - - my $count_lex= 0; - if (!open (TLEX,"<$path_to_lex_file")) - { - print STDERR "Error opening lex file \"$path_to_lex_file\" $!\n"; - } - else - { - for () - { - my ($a,$lex,$b)=m|(.+?)\"(.+?)\"(.+?)$|; - next if ($lex eq ""); - $count_lex++; - next if (exists($topics{$lex}) || exists($keywords{$lex})); - push(@without_help,$lex); - } - close(TLEX); - print STDERR "number of lexems in \"$path_to_lex_file\" - $count_lex\n"; - } - - my $name; - my @topic_names= keys(%topics); - foreach $name (@topic_names) - { - my $topic= $topics{$name}; - push(@description_with_at,$name) if ($topic->{description}=~/\@/); - push(@example_with_at,$name) if ($topic->{example}=~/\@/); - push(@without_description,$name) if (!exists($topic->{description})); - push(@without_example,$name) if (!exists($topic->{example})); - } - - my $count_categories= scalar(keys(%categories)); - print STDERR "number of help categories - ",$count_categories,"\n"; - my $count_topics= scalar(@topic_names); - print STDERR "number of help topics - ",$count_topics,"\n"; - my $count_keywords= scalar(keys(%keywords)); - print STDERR "number of help keywords - ",$count_keywords,"\n"; - - my $count_without_help= scalar(@without_help); - my $percent_without_help= $count_lex ? - int (($count_without_help/$count_lex)*100) : - "100"; - print_bad_names(\@without_help,"lexems without help (". - $count_without_help." ~ ". - $percent_without_help."%)"); - print_bad_names(\@description_with_at, - " topics below have symbol \'@\' in their descriptions.\n". - "it's probably the litter from 'texi' tags (script needs fixing)"); - print_bad_names(\@example_with_at, - " topics below have symbol \'@\' in their examples.\n". - "it's probably the litter from 'texi' tags (script needs fixing)"); - print_bad_names(\@without_description,"topics without description"); - - my $count_without_example= scalar(@without_example); - my $percent_without_example= $count_topics ? - int (($count_without_example/$count_topics)*100) : - "100"; - print_bad_names(\@without_example,"topics without example (". - $count_without_example." ~ ". - $percent_without_example."%)"); -} - -print_verbose_errors if ($verbose_option ne 0); - -# output result - -sub print_insert_header -{ - my($count,$header)= @_; - - if ($count % $insert_portion_size ne 0) { - print ","; - } else { - print ";\n" if ($count ne 0); - print "$header"; - } -} - -print <{__id__}= $count; - $count++; - } - - my $header= "insert into help_category ". - "(help_category_id,name,parent_category_id) values "; - $count= 0; - foreach $cat_name (@category_names) - { - print_insert_header($count,$header); - my $parent_cat_name= $categories{$cat_name}->{__parent_category__}; - my $parent_cat_id= $parent_cat_name eq "" - ? "-1" : $categories{$parent_cat_name}->{__id__}; - print "($count,\"$cat_name\",$parent_cat_id)"; - $count++; - } - printf ";\n\n"; -} - -my @topic_names= keys(%topics); -if (scalar(@topic_names)) -{ - my $header= "insert into help_topic ". - "(help_topic_id,help_category_id,name,description,example) values "; - my $topic_name; - my $count= 0; - foreach $topic_name (@topic_names) - { - print_insert_header($count,$header); - my $topic= $topics{$topic_name}; - print "($count,"; - print "$topic->{category}->{__id__},"; - print "\"$topic_name\","; - print "\"$topic->{description}\","; - print "\"$topic->{example}\")"; - $topics{$topic_name}->{__id__}= $count; - $count++; - } - printf ";\n\n"; -} - -my @keywords_names= keys(%keywords); -if (scalar(@keywords_names)) -{ - my $header= "insert into help_keyword (help_keyword_id,name) values "; - my $keyword_name; - my $count= 0; - foreach $keyword_name (@keywords_names) - { - print_insert_header($count,$header); - print "($count,\"$keyword_name\")"; - $count++; - } - printf ";\n\n"; - - $header= "insert into help_relation ". - "(help_topic_id,help_keyword_id) values "; - $count= 0; - my $count_keyword= 0; - foreach $keyword_name (@keywords_names) - { - my $topic_name; - foreach $topic_name (keys(%{$keywords{$keyword_name}})) - { - print_insert_header($count,$header); - print "($topics{$topic_name}->{__id__},$count_keyword)"; - $count++; - } - $count_keyword++; - } - printf ";\n\n"; -} - -if ($count_errors) -{ - print STDERR "$count_errors errors !!!\n"; - exit 1; -} -- cgit v1.2.1 From 75686dc73f0e2d5af85a9cd77fccbf2896189a42 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 29 Mar 2007 08:17:19 -0400 Subject: WL#3629 - Replication of Invocation and Invoked Features This patch corrects errors that occurred in a local manual merge as a result of updating the local repository and includes changes necessary to correct problems found during the recalculation of next execution of events in RBR. mysql-test/include/rpl_events.inc: WL#3629 - Replication of Invocation and Invoked Features This patch changes the rpl_events test to be more comprehensive in catching errors as a result of RBR. Changes include clarification of SELECTs with WHERE clauses and synchronization with master and slave. mysql-test/r/rpl_events.result: WL#3629 - Replication of Invocation and Invoked Features This patch changes the results for the rpl_events test to accomodate the changes in the test. scripts/mysql_system_tables.sql: WL#3629 - Replication of Invocation and Invoked Features This patch adds the originator column and a new enum value to the mysql.event table. This change was necessary to accomodate changes as a result of other patches. sql/event_data_objects.cc: WL#3629 - Replication of Invocation and Invoked Features This patch corrects an error in merging that occurred during manual merge. The status check was changed to include either ENABLED or DISABLED in the gate to change the status to SLAVESIDE_DISABLED for events replicated to the slave. This patch also includes an update to correct a problem encountered during testing after the local merge. The update_timing_fields method is replicating the timing changes in RBR to the slave thereby over writing the change to the status column in the process. This code includes a check to turn off the next binlog event if in RBR. sql/event_queue.cc: WL#3629 - Replication of Invocation and Invoked Features This patch corrects an error in merging that occurred during manual merge. The code was corrected to include both types of disabled status enums (DISABLED, SLAVESIDE_DISABLED) in the create_event and update_event methods. sql/sql_show.cc: WL#3629 - Replication of Invocation and Invoked Features This patch corrects an error in merging that occurred during manual merge. It corrects the order in which the originator column appears in the show structures. The error caused incorrect output on SHOW EVENTS commands. --- scripts/mysql_system_tables.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql index 7be5c94ad80..0c386fdc9c2 100644 --- a/scripts/mysql_system_tables.sql +++ b/scripts/mysql_system_tables.sql @@ -70,7 +70,7 @@ CALL create_slow_log_table(); DROP PROCEDURE create_slow_log_table; -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') 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') DEFAULT '' NOT NULL, comment char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', 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','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') DEFAULT '' NOT NULL, comment char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', originator int(10) NOT NULL, 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; -- cgit v1.2.1 From 169771462158ec5da9112322d803f027ed39e19b Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 29 Mar 2007 16:42:08 +0200 Subject: Bug#26922 Test 'varbinary' fails to do copy_file on Windows - Copy all *.MY* files from std_data/, we have some .MYD and .MYI files from 4.1 there 5.0 version of make_win_bin_dist copies everything in std_data/ scripts/make_win_bin_dist: Copy all *.MY* files from std_data/, we have some .MYD and .MYI files from 4.1 there 5.0 version of make_win_bin_dist copies everything in std_data/ --- scripts/make_win_bin_dist | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index 146dcad95f1..1cd4141f532 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -302,6 +302,7 @@ cp mysql-test/std_data/*.cnf $DESTDIR/mysql-test/std_data/ cp mysql-test/std_data/*.dat $DESTDIR/mysql-test/std_data/ cp mysql-test/std_data/*.frm $DESTDIR/mysql-test/std_data/ cp mysql-test/std_data/*.pem $DESTDIR/mysql-test/std_data/ +cp mysql-test/std_data/*.MY* $DESTDIR/mysql-test/std_data/ cp mysql-test/t/*.opt $DESTDIR/mysql-test/t/ cp mysql-test/t/*.sh $DESTDIR/mysql-test/t/ cp mysql-test/t/*.slave-mi $DESTDIR/mysql-test/t/ -- cgit v1.2.1 From d3ef3c9f2fd4eb0dd907755174dba1bb5b4fac95 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 29 Mar 2007 16:43:00 -0400 Subject: WL#3629 - Replication of Invocation and Invoked Features This patch changes test to remove Windows-specific limitations and potential rounding errors in the calculation of a UDF. Also corrects a minor merge conflict. mysql-test/include/rpl_udf.inc: WL#3629 - Replication of Invocation and Invoked Features This patch changes test to remove Windows-specific results by replacing the library name in the SELECT from mysql.func to "UDF_LIB" to allow for the differences in platform (.so vs .dll). The patch also changes the function body of myfuncsql_double to a calculation that does not result in potential rounding errors from the test data. mysql-test/r/rpl_udf.result: WL#3629 - Replication of Invocation and Invoked Features This patch changes the result file for the test to match the new expected values for the SELECT from mysql.func and the return of myfuncsql_double. scripts/mysql_system_tables_fix.sql: WL#3629 - Replication of Invocation and Invoked Features This patch corrects a merge error encountered in a previous merge. The column originator should be listed before time_zone in mysql.event. --- scripts/mysql_system_tables_fix.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_system_tables_fix.sql b/scripts/mysql_system_tables_fix.sql index 38c22d8f854..e9816bd21e9 100644 --- a/scripts/mysql_system_tables_fix.sql +++ b/scripts/mysql_system_tables_fix.sql @@ -481,7 +481,7 @@ ALTER TABLE event ADD COLUMN originator INT(10) NOT NULL; ALTER TABLE event MODIFY COLUMN status ENUM('ENABLED','DISABLED','SLAVESIDE_DISABLED') NOT NULL default 'ENABLED'; ALTER TABLE event ADD COLUMN time_zone char(64) CHARACTER SET latin1 - NOT NULL DEFAULT 'SYSTEM' AFTER comment; + NOT NULL DEFAULT 'SYSTEM' AFTER originator; # # TRIGGER privilege -- cgit v1.2.1 From 30cb61d0572bf055df2e14dc8ad9015def21af01 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 2 Apr 2007 15:20:46 +0200 Subject: BUG#27489 build fix scripts/make_binary_distribution.sh: BUG#27489 make_binary_distribution doesn't copy all files --- scripts/make_binary_distribution.sh | 43 +++++++++++++++++++++++++------------ 1 file changed, 29 insertions(+), 14 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index eab3af29ad1..9101f7f0948 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -54,6 +54,21 @@ for arg do esac done +# Avoid too long command lines for cp (bug#27489) +MCP() { + for i + do + last=$i + done + for i + do + if test "x$i" != "x$last" + then + cp -p $i $last + fi + done +} + # Remove vendor from $system system=`echo $system | sed -e 's/[a-z]*-\(.*\)/\1/g'` @@ -253,25 +268,25 @@ copyfileto $BASE/mysql-test \ mysql-test/valgrind.supp \ netware/mysql_test_run.nlm netware/install_test_db.ncf -$CP mysql-test/lib/*.pl $BASE/mysql-test/lib -$CP mysql-test/t/*.def $BASE/mysql-test/t -$CP mysql-test/include/*.inc $BASE/mysql-test/include -$CP mysql-test/include/*.test $BASE/mysql-test/include -$CP mysql-test/t/*.def $BASE/mysql-test/t -$CP mysql-test/std_data/*.dat mysql-test/std_data/*.frm \ +MCP mysql-test/lib/*.pl $BASE/mysql-test/lib +MCP mysql-test/t/*.def $BASE/mysql-test/t +MCP mysql-test/include/*.inc $BASE/mysql-test/include +MCP mysql-test/include/*.test $BASE/mysql-test/include +MCP mysql-test/t/*.def $BASE/mysql-test/t +MCP mysql-test/std_data/*.dat mysql-test/std_data/*.frm \ mysql-test/std_data/*.MYD mysql-test/std_data/*.MYI \ mysql-test/std_data/*.pem mysql-test/std_data/Moscow_leap \ mysql-test/std_data/des_key_file mysql-test/std_data/*.*001 \ mysql-test/std_data/*.cnf mysql-test/std_data/*.MY* \ $BASE/mysql-test/std_data -$CP mysql-test/t/*.test $BASE/mysql-test/t -$CP mysql-test/t/*.imtest mysql-test/t/*.disabled $BASE/mysql-test/t -$CP mysql-test/t/*.opt mysql-test/t/*.slave-mi $BASE/mysql-test/t -$CP mysql-test/t/*.sh mysql-test/t/*.sql $BASE/mysql-test/t -$CP mysql-test/r/*.result $BASE/mysql-test/r -$CP mysql-test/r/*.require $BASE/mysql-test/r -$CP mysql-test/extra/binlog_tests/*.test $BASE/mysql-test/extra/binlog_tests -$CP mysql-test/extra/rpl_tests/*.test $BASE/mysql-test/extra/rpl_tests +MCP mysql-test/t/*.test $BASE/mysql-test/t +MCP mysql-test/t/*.imtest mysql-test/t/*.disabled $BASE/mysql-test/t +MCP mysql-test/t/*.opt mysql-test/t/*.slave-mi $BASE/mysql-test/t +MCP mysql-test/t/*.sh mysql-test/t/*.sql $BASE/mysql-test/t +MCP mysql-test/r/*.result $BASE/mysql-test/r +MCP mysql-test/r/*.require $BASE/mysql-test/r +MCP mysql-test/extra/binlog_tests/*.test $BASE/mysql-test/extra/binlog_tests +MCP mysql-test/extra/rpl_tests/*.test $BASE/mysql-test/extra/rpl_tests if [ $BASE_SYSTEM != "netware" ] ; then chmod a+x $BASE/bin/* -- cgit v1.2.1 From fe0716d0378994caee61b6fd6ad15059a2fabdc0 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 4 Apr 2007 14:19:47 +0200 Subject: build fixes for 5.1.17 CMakeLists.txt: use correct runtime library for RelWithDebugInfo target and always generate .map files scripts/make_win_bin_dist: use RelWithDebInfo target output if exists, include copy mysqld and mysqlmanager debug info in distribution --- scripts/make_win_bin_dist | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) (limited to 'scripts') diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index 146dcad95f1..9916d71e724 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -126,6 +126,15 @@ if [ -e $DESTDIR ] ; then usage fi +# ---------------------------------------------------------------------- +# Adjust target name if needed, release with debug info has another name +# ---------------------------------------------------------------------- + +if [ x"$TARGET" = x"release" -a -f "client/relwithdebinfo/mysql.exe" ] +then + TARGET="relwithdebinfo" +fi + # ---------------------------------------------------------------------- # Copy executables, and client DLL (FIXME why?) # ---------------------------------------------------------------------- @@ -134,18 +143,20 @@ trap 'echo "Clearning up and exiting..." ; rm -fr $DESTDIR; exit 1' ERR mkdir $DESTDIR mkdir $DESTDIR/bin -cp client/$TARGET/*.exe $DESTDIR/bin/ -cp extra/$TARGET/*.exe $DESTDIR/bin/ -cp storage/myisam/$TARGET/*.exe $DESTDIR/bin/ -cp server-tools/instance-manager/$TARGET/*.exe $DESTDIR/bin/ -cp tests/$TARGET/*.exe $DESTDIR/bin/ -cp libmysql/$TARGET/*.exe $DESTDIR/bin/ -cp libmysql/$TARGET/libmysql.dll $DESTDIR/bin/ +cp client/$TARGET/*.exe $DESTDIR/bin/ +cp extra/$TARGET/*.exe $DESTDIR/bin/ +cp storage/myisam/$TARGET/*.exe $DESTDIR/bin/ +cp server-tools/instance-manager/$TARGET/*.{exe,map,pdb} $DESTDIR/bin/ +cp tests/$TARGET/*.exe $DESTDIR/bin/ +cp libmysql/$TARGET/*.exe $DESTDIR/bin/ +cp libmysql/$TARGET/libmysql.dll $DESTDIR/bin/ # FIXME really needed?! mv $DESTDIR/bin/comp_err.exe $DESTDIR/bin/comp-err.exe cp sql/$TARGET/mysqld.exe $DESTDIR/bin/mysqld$EXE_SUFFIX.exe +cp sql/$TARGET/mysqld.pdb $DESTDIR/bin/mysqld$EXE_SUFFIX.pdb +cp sql/$TARGET/mysqld.map $DESTDIR/bin/mysqld$EXE_SUFFIX.map if [ x"$PACK_DEBUG" = "" -a -f "sql/debug/mysqld.exe" -o \ x"$PACK_DEBUG" = "yes" ] ; then @@ -342,6 +353,9 @@ done cp -pR sql/share $DESTDIR/ +# The SQL initiation code is really expected to be in "share" +mv $DESTDIR/scripts/*.sql $DESTDIR/share/ || true + # ---------------------------------------------------------------------- # Copy other files specified on command line DEST=SOURCE # ---------------------------------------------------------------------- -- cgit v1.2.1 From 60289fba0ba697e2bbab6136e7840216bea0633d Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 5 Apr 2007 08:36:56 +0200 Subject: zlib.m4: Only require the more recent zlibCompileFlags() when building the server, client zlib don't need it. Makefile.am: Always build the bundled zlib static only configure.in: Look for dlopen() even if --with-mysqld-ldflags constains "-static", as this is not the same as the flag to "ld", it just informs "libtool" to link static with libraries created part of the build, even if there exists shared versions. make_binary_distribution.sh: Real "mysqlmanager" executable might be in ".libs" configure.in: Look for dlopen() even if --with-mysqld-ldflags constains "-static", as this is not the same as the flag to "ld", it just informs "libtool" to link static with libraries created part of the build, even if there exists shared versions. config/ac-macros/zlib.m4: Only require the more recent zlibCompileFlags() when building the server, client zlib don't need it. scripts/make_binary_distribution.sh: Real "mysqlmanager" executable might be in ".libs" zlib/Makefile.am: Always build the bundled zlib static only --- scripts/make_binary_distribution.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 7d7918975f2..e8bf39bd016 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -115,7 +115,12 @@ if [ $BASE_SYSTEM != "netware" ] ; then chmod o-rwx $BASE/data $BASE/data/* fi -# Copy files if they exists, warn for those that don't +# Copy files if they exists, warn for those that don't. +# Note that when listing files to copy, we might list the file name +# twice, once in the directory location where it is build, and a +# second time in the ".libs" location. In the case the firs one +# is a wrapper script, the second one will overwrite it with the +# binary file. copyfileto() { destdir=$1 @@ -165,6 +170,7 @@ if [ $BASE_SYSTEM = "netware" ] ; then # For all other platforms: else BIN_FILES="$BIN_FILES \ + server-tools/instance-manager/.libs/mysqlmanager \ client/mysqltestmanagerc \ client/mysqltestmanager-pwgen tools/mysqltestmanager \ client/.libs/mysql client/.libs/mysqlshow client/.libs/mysqladmin \ -- cgit v1.2.1 From 056e6ba495b9978dcfb208dfd995471a39a2f6a1 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 11 Apr 2007 14:27:03 +0200 Subject: don't copy pdb files from the release target output folder, since this target does not build them scripts/make_win_bin_dist: don't try to copy the pdb files from the release output folder --- scripts/make_win_bin_dist | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index 862c572a75a..2e10e530ca6 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -146,7 +146,11 @@ mkdir $DESTDIR/bin cp client/$TARGET/*.exe $DESTDIR/bin/ cp extra/$TARGET/*.exe $DESTDIR/bin/ cp storage/myisam/$TARGET/*.exe $DESTDIR/bin/ -cp server-tools/instance-manager/$TARGET/*.{exe,map,pdb} $DESTDIR/bin/ +cp server-tools/instance-manager/$TARGET/*.{exe,map} $DESTDIR/bin/ +if [ x"$TARGET" != x"release" ] +then + cp server-tools/instance-manager/$TARGET/*.pdb $DESTDIR/bin/ +fi cp tests/$TARGET/*.exe $DESTDIR/bin/ cp libmysql/$TARGET/*.exe $DESTDIR/bin/ cp libmysql/$TARGET/libmysql.dll $DESTDIR/bin/ @@ -155,8 +159,11 @@ cp libmysql/$TARGET/libmysql.dll $DESTDIR/bin/ mv $DESTDIR/bin/comp_err.exe $DESTDIR/bin/comp-err.exe cp sql/$TARGET/mysqld.exe $DESTDIR/bin/mysqld$EXE_SUFFIX.exe -cp sql/$TARGET/mysqld.pdb $DESTDIR/bin/mysqld$EXE_SUFFIX.pdb cp sql/$TARGET/mysqld.map $DESTDIR/bin/mysqld$EXE_SUFFIX.map +if [ x"$TARGET" != x"release" ] +then + cp sql/$TARGET/mysqld.pdb $DESTDIR/bin/mysqld$EXE_SUFFIX.pdb +fi if [ x"$PACK_DEBUG" = "" -a -f "sql/debug/mysqld.exe" -o \ x"$PACK_DEBUG" = "yes" ] ; then -- cgit v1.2.1 From 87a99ed780328c1855d4f2e541033d8b647d7736 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 12 Apr 2007 17:48:28 +0200 Subject: Bug#27783 mysql_install_db should be able to install again, preserving existing files. - Allow mysql_install_db to be run a second time in the same datadir to create and fill any missing system tables scripts/mysql_install_db.sh: Remove check that dissallowed running mysql_install_db a second time in same directory scripts/mysql_system_tables.sql: Save information about if tables db and user already existed scripts/mysql_system_tables_data.sql: Fill tables db and user with initial data if tables didn't already exist. --- scripts/mysql_install_db.sh | 11 ----------- scripts/mysql_system_tables.sql | 5 +++++ scripts/mysql_system_tables_data.sql | 22 +++++++++++++++------- 3 files changed, 20 insertions(+), 18 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index c1a27eb0bc8..63995eb1575 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -135,17 +135,6 @@ else fi fi -# Check that no previous MySQL installation exist -if test -f "$ldata/mysql/db.frm" -then - echo "FATAL ERROR: Found already existing MySQL system tables" - echo "in $ldata." - echo "If you are upgrading from a previous MySQL version you" - echo "should run '$bindir/mysql_upgrade', " - echo "to upgrade all tables for this version of MySQL" - exit 1; -fi - # Find SQL scripts needed for bootstrap fill_help_tables="fill_help_tables.sql" create_system_tables="mysql_system_tables.sql" diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql index 5f5aea20729..d9c870f1d73 100644 --- a/scripts/mysql_system_tables.sql +++ b/scripts/mysql_system_tables.sql @@ -6,12 +6,17 @@ 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, PRIMARY KEY Host (Host,Db,User), KEY User (User) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Database privileges'; +-- Remember for later if db table already existed +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, 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, 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'; +-- Remember for later if user table already existed +set @had_user_table= @@warning_count != 0; + CREATE TABLE IF NOT EXISTS func ( name char(64) binary DEFAULT '' NOT NULL, ret tinyint(1) DEFAULT '0' NOT NULL, dl char(128) DEFAULT '' NOT NULL, type enum ('function','aggregate') COLLATE utf8_general_ci NOT NULL, PRIMARY KEY (name) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='User defined functions'; diff --git a/scripts/mysql_system_tables_data.sql b/scripts/mysql_system_tables_data.sql index a9c816f2896..5f0289ab197 100644 --- a/scripts/mysql_system_tables_data.sql +++ b/scripts/mysql_system_tables_data.sql @@ -2,12 +2,20 @@ -- 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'); +-- Fill "db" table with default grants for anyone to +-- access database 'test' and 'test_%' if "db" table didn't exist +CREATE TEMPORARY TABLE tmp_db LIKE db; +INSERT INTO tmp_db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N'); +INSERT INTO tmp_db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N'); +INSERT INTO db SELECT * FROM tmp_db WHERE @had_db_table=0; +DROP TABLE tmp_db; --- 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); +-- Fill "users" table with default users allowing root access +-- from local machine if "users" table didn't exist before +CREATE TEMPORARY TABLE tmp_user LIKE user; +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','','','','',0,0,0,0); +REPLACE INTO tmp_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 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','','','','',0,0,0,0); +INSERT INTO user SELECT * FROM tmp_user WHERE @had_user_table=0; +DROP TABLE tmp_user; -- cgit v1.2.1 From 1d24597ff94a45e714151f3024a013e44a569169 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 18 Apr 2007 13:21:39 +0200 Subject: Bug#25452 mysql_upgrade access denied - Improve mysql_upgrade and add comments describing it's logic - Don't look for mysql and mysqlcheck randomly, use dir where mysql_upgrade was started from - Don't look for mysql_fix_privilege_tables.sql randomly, compile in the mysql_fix_privilege_tables.sql file and use that to upgrade the system tables of MySQL - Check for any unexpected error returned from runnning the mysql_fix_privilege_tables SQL - Fix bug#26639, bug#24248 and bug#25405 BitKeeper/etc/ignore: Added scripts/comp_sql scripts/mysql_fix_privilege_tables_sql.c to the ignore list CMakeLists.txt: Build files also in scripts/ Makefile.am: Build scripts/ a little earlier to make the scripts/mysql_fix_privilege_tables_sql.c file available when client/ is built client/mysql_upgrade.c: Updated version of mysql_upgrade with comments and logical functions include/my_global.h: Move IF_WIN macro to my_global.h fr from sql/mysql_priv.h mysql-test/r/mysql_upgrade.result: Update result mysql-test/t/mysql_upgrade.test: Add more tests for different bugs related to mysql_upgrade scripts/Makefile.am: Build comp_sql and mysql_fix_privilege_tables_sql.c sql/mysql_priv.h: Move IF_WIN macro to my_global.h fr from sql/mysql_priv.h scripts/CMakeLists.txt: New BitKeeper file ``scripts/CMakeLists.txt'' scripts/comp_sql.c: New BitKeeper file ``scripts/comp_sql.c'' --- scripts/CMakeLists.txt | 28 ++++++++++++ scripts/Makefile.am | 14 ++++++ scripts/comp_sql.c | 119 +++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 161 insertions(+) create mode 100755 scripts/CMakeLists.txt create mode 100644 scripts/comp_sql.c (limited to 'scripts') diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt new file mode 100755 index 00000000000..8580844097e --- /dev/null +++ b/scripts/CMakeLists.txt @@ -0,0 +1,28 @@ +# Copyright (C) 2006 MySQL AB +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + +ADD_EXECUTABLE(comp_sql comp_sql.c) +TARGET_LINK_LIBRARIES(comp_sql dbug mysys strings) + +# Build comp_sql - used for embedding SQL in C or C++ programs +GET_TARGET_PROPERTY(COMP_SQL_EXE comp_sql LOCATION) + +ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_SOURCE_DIR}/client/mysql_fix_privilege_tables_sql.c + COMMAND ${COMP_SQL_EXE} + ${PROJECT_SOURCE_DIR}/scripts/mysql_fix_privilege_tables.sql + ${PROJECT_SOURCE_DIR}/client/mysql_fix_privilege_tables_sql.c + DEPENDS comp_sql ${PROJECT_SOURCE_DIR}/scripts/mysql_fix_privilege_tables.sql) + diff --git a/scripts/Makefile.am b/scripts/Makefile.am index d7053a86b3a..e4a75ab4591 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -165,5 +165,19 @@ SUFFIXES = .sh @CHMOD@ +x $@-t @MV@ $@-t $@ + +BUILT_SOURCES = mysql_fix_privilege_tables_sql.c +noinst_PROGRAMS = comp_sql + +# +# Build mysql_fix_privilege_tables_sql.c from +# mysql_fix_privileges_tables.sql using comp_sql +# +mysql_fix_privilege_tables_sql.c: comp_sql.c mysql_fix_privilege_tables.sql + $(MAKE) $(AM_MAKEFLAGS) comp_sql$(EXEEXT) + $(top_builddir)/scripts/comp_sql$(EXEEXT) \ + mysql_fix_privilege_tables.sql $@ + + # Don't update the files from bitkeeper %::SCCS/s.% diff --git a/scripts/comp_sql.c b/scripts/comp_sql.c new file mode 100644 index 00000000000..60236774701 --- /dev/null +++ b/scripts/comp_sql.c @@ -0,0 +1,119 @@ +/* Copyright (C) 2004 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + Written by Magnus Svensson +*/ + +/* + Converts a SQL file into a C file that can be compiled and linked + into other programs +*/ + +#include +#include +#include + +FILE *in, *out; + +static void die(const char *fmt, ...) +{ + va_list args; + + /* Print the error message */ + fprintf(stderr, "FATAL ERROR: "); + if (fmt) + { + va_start(args, fmt); + vfprintf(stderr, fmt, args); + va_end(args); + } + else + fprintf(stderr, "unknown error"); + fprintf(stderr, "\n"); + fflush(stderr); + + /* Close any open files */ + if (in) + fclose(in); + if (out) + fclose(out); + + exit(1); +} + + +int main(int argc, char *argv[]) +{ + char buff[512]; + char* infile_name= argv[1]; + char* outfile_name= argv[2]; + char* end= infile_name; + + if (argc != 3) + die("Usage: comp_sql "); + + /* 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); + + while(*end && *end != '.') + end++; + *end= 0; + fprintf(out, "const char* %s={\"\\\n", infile_name); + + while (fgets(buff, sizeof(buff), in)) + { + char *curr= buff; + while (*curr) + { + 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 + { + if (*curr == '"') + { + /* Needs escape */ + fputc('\\', out); + } + + fputc(*curr, out); + curr++; + } + } + } + + fprintf(out, "\\\n\"};\n"); + + fclose(in); + fclose(out); + + exit(0); + +} + -- cgit v1.2.1 From 07ec45cc557fe7224cb3f675c6b7be46258f07a3 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 18 Apr 2007 16:23:19 +0200 Subject: Update mysql_upgrade tests for 5.1 Add "two liner" to mysqld --bootstrap that allows wo write scripts that can be run both by mysql and mysqld --bootstrap Remove duplicate create of MySQL system tables mysql-test/r/mysql_upgrade.result: Update mysql_upgrade.result for new tables in 5.1 scripts/mysql_system_tables.sql: Use "delimiter ;;" to make it possible to run the script both with "mysql" and "mysqld --bootstrap" scripts/mysql_system_tables_fix.sql: Remove duplicate stored procedure for creating slow_log and general_log. Remove duplicate CREATE of ndb_binlog_index. Those are already defined in mysql_system_tables.sql sql/sql_parse.cc: Make "mysqld --bootstrap skip lines startig with "delimiter" thus making it possible to write sql scripts containing stored procedures that can be executed both with "mysql" and "mysqld --bootstrap" --- scripts/mysql_system_tables.sql | 18 ++++++++--------- scripts/mysql_system_tables_fix.sql | 39 ------------------------------------- 2 files changed, 9 insertions(+), 48 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql index 3250aa0fc9a..c779d174d12 100644 --- a/scripts/mysql_system_tables.sql +++ b/scripts/mysql_system_tables.sql @@ -65,15 +65,15 @@ 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 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(); -DROP PROCEDURE create_general_log_table; - - -CREATE PROCEDURE create_slow_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 slow_log (start_time TIMESTAMP NOT NULL, user_host MEDIUMTEXT NOT NULL, query_time TIME NOT NULL, lock_time TIME NOT NULL, rows_sent INTEGER NOT NULL, rows_examined INTEGER NOT NULL, db VARCHAR(512), last_insert_id INTEGER, insert_id INTEGER, server_id INTEGER, sql_text MEDIUMTEXT NOT NULL) engine=CSV CHARACTER SET utf8 comment='Slow log'; END IF; END; -CALL create_slow_log_table(); -DROP PROCEDURE create_slow_log_table; - +delimiter ;; +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();; +DROP PROCEDURE create_general_log_table;; + +CREATE PROCEDURE create_slow_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 slow_log (start_time TIMESTAMP NOT NULL, user_host MEDIUMTEXT NOT NULL, query_time TIME NOT NULL, lock_time TIME NOT NULL, rows_sent INTEGER NOT NULL, rows_examined INTEGER NOT NULL, db VARCHAR(512), last_insert_id INTEGER, insert_id INTEGER, server_id INTEGER, sql_text MEDIUMTEXT NOT NULL) engine=CSV CHARACTER SET utf8 comment='Slow log'; END IF; END;; +CALL create_slow_log_table();; +DROP PROCEDURE create_slow_log_table;; +delimiter ; 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') DEFAULT '' NOT NULL, comment char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', originator int(10) NOT NULL, time_zone char(64) CHARACTER SET latin1 NOT NULL DEFAULT 'SYSTEM', PRIMARY KEY (db, name) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT 'Events'; diff --git a/scripts/mysql_system_tables_fix.sql b/scripts/mysql_system_tables_fix.sql index e9816bd21e9..7985dc1802e 100644 --- a/scripts/mysql_system_tables_fix.sql +++ b/scripts/mysql_system_tables_fix.sql @@ -388,43 +388,6 @@ ALTER TABLE proc MODIFY db MODIFY comment char(64) collate utf8_bin DEFAULT '' NOT NULL; -# -# Create missing log tables (5.1) -# - -delimiter // -CREATE PROCEDURE create_log_tables() -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'; - CREATE TABLE IF NOT EXISTS slow_log ( - start_time TIMESTAMP NOT NULL, - user_host MEDIUMTEXT NOT NULL, - query_time TIME NOT NULL, - lock_time TIME NOT NULL, - rows_sent INTEGER NOT NULL, - rows_examined INTEGER NOT NULL, - db VARCHAR(512), - last_insert_id INTEGER, - insert_id INTEGER, - server_id INTEGER, - sql_text MEDIUMTEXT NOT NULL - ) engine=CSV CHARACTER SET utf8 comment='Slow log'; - END IF; -END// -delimiter ; -CALL create_log_tables(); -DROP PROCEDURE create_log_tables; - # # EVENT privilege # @@ -503,8 +466,6 @@ ALTER TABLE tables_priv MODIFY Table_priv set('Select','Insert','Update','Delete UPDATE user SET Trigger_priv=Super_priv WHERE @hadTriggerPriv = 0; -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; - # Activate the new, possible modified privilege tables # This should not be needed, but gives us some extra testing that the above # changes was correct -- cgit v1.2.1 From b4573eb4caff7e2a112c79f7923d565fb836e8a0 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 18 Apr 2007 19:34:33 +0200 Subject: Add CMakeLists.txt to EXTRA_DIST --- scripts/Makefile.am | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index e4a75ab4591..e9398fc1a72 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -65,7 +65,8 @@ EXTRA_DIST = $(EXTRA_SCRIPTS) \ mysqlaccess.conf \ mysqlbug \ make_win_bin_dist \ - mysql_system_tables_fix.sql + mysql_system_tables_fix.sql \ + CMakeLists.txt dist_pkgdata_DATA = fill_help_tables.sql \ mysql_fix_privilege_tables.sql \ -- cgit v1.2.1 From 4fff310ecfc2958483b3b01375c6b54afd443f7a Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 19 Apr 2007 17:00:29 +0200 Subject: mysql_upgrade win fixes client/mysql_upgrade.c: Windows fix scripts/CMakeLists.txt: Fix problems with CMakeList causing build to fail scripts/comp_sql.c: Improve comp_sql.c to generate output file with shorter strings --- scripts/CMakeLists.txt | 9 ++++++--- scripts/comp_sql.c | 4 ++-- 2 files changed, 8 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index 8580844097e..cb5efd0ff9b 100755 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -20,9 +20,12 @@ TARGET_LINK_LIBRARIES(comp_sql dbug mysys strings) # Build comp_sql - used for embedding SQL in C or C++ programs GET_TARGET_PROPERTY(COMP_SQL_EXE comp_sql LOCATION) -ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_SOURCE_DIR}/client/mysql_fix_privilege_tables_sql.c +ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_SOURCE_DIR}/scripts/mysql_fix_privilege_tables_sql.c COMMAND ${COMP_SQL_EXE} - ${PROJECT_SOURCE_DIR}/scripts/mysql_fix_privilege_tables.sql - ${PROJECT_SOURCE_DIR}/client/mysql_fix_privilege_tables_sql.c + mysql_fix_privilege_tables.sql + mysql_fix_privilege_tables_sql.c DEPENDS comp_sql ${PROJECT_SOURCE_DIR}/scripts/mysql_fix_privilege_tables.sql) +ADD_CUSTOM_TARGET(GenFixPrivs + ALL + DEPENDS ${PROJECT_SOURCE_DIR}/scripts/mysql_fix_privilege_tables_sql.c) diff --git a/scripts/comp_sql.c b/scripts/comp_sql.c index 60236774701..328dab0cf13 100644 --- a/scripts/comp_sql.c +++ b/scripts/comp_sql.c @@ -74,7 +74,7 @@ int main(int argc, char *argv[]) while(*end && *end != '.') end++; *end= 0; - fprintf(out, "const char* %s={\"\\\n", infile_name); + fprintf(out, "const char* %s={\n\"", infile_name); while (fgets(buff, sizeof(buff), in)) { @@ -87,7 +87,7 @@ int main(int argc, char *argv[]) Reached end of line, add escaped newline, escaped backslash and a newline to outfile */ - fprintf(out, "\\n\\\n"); + fprintf(out, "\\n \"\n\""); curr++; } else if (*curr == '\r') -- cgit v1.2.1 From 36cd228af11ab85df1dbab55138316933107f8bd Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 19 Apr 2007 21:30:46 +0200 Subject: mysql_upgrade portability fixes client/mysql_upgrade.c: Add defines for WEXITSTATUS Pass arguments on command line instead of --defaults-file= mysql-test/r/mysql_upgrade.result: When testing that mysql_upgrade detect if mysqlcheck fails, use an option that is used on all platforms. mysql-test/t/mysql_upgrade.test: When testing that mysql_upgrade detect if mysqlcheck fails, use an option that is used on all platforms. scripts/comp_sql.c: Some compilers have a max string length, insert a newline at every 512th char in long strings --- scripts/comp_sql.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'scripts') diff --git a/scripts/comp_sql.c b/scripts/comp_sql.c index 328dab0cf13..53359d384c1 100644 --- a/scripts/comp_sql.c +++ b/scripts/comp_sql.c @@ -106,6 +106,15 @@ int main(int argc, char *argv[]) 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\""); + } } fprintf(out, "\\\n\"};\n"); -- cgit v1.2.1 From f6409de79ab93af445166dfb46670f077a257094 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 20 Apr 2007 20:46:55 +0200 Subject: Don't copy subidrs of scripts/ --- scripts/make_win_bin_dist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index 2e10e530ca6..42fade7cbd2 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -352,7 +352,7 @@ mkdir -p $DESTDIR/scripts for i in `cd scripts && ls`; do \ if echo $i | grep -q '\.sh'; then \ cp scripts/$i $DESTDIR/scripts/`echo $i | sed -e 's/\.sh$//'`; \ - elif [ $i = Makefile.am -o $i = Makefile.in -o -e scripts/$i.sh ] ; then \ + elif [ -d scripts/$i -o $i = Makefile.am -o $i = Makefile.in -o -e scripts/$i.sh ] ; then \ : ; \ else \ cp scripts/$i $DESTDIR/scripts/$i; \ -- cgit v1.2.1 From b44eee2a6739afb44f59a06c2f7adb309f66b6a9 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 23 Apr 2007 14:01:48 +0200 Subject: Add "name of struct" as first arg to comp_sql Fix "make distcheck" scripts/CMakeLists.txt: Add "name of struct" as first arg to comp_sql scripts/comp_sql.c: Add "name of struct" as first arg to comp_sql --- scripts/CMakeLists.txt | 1 + scripts/Makefile.am | 32 ++++++++++++++++++-------------- scripts/comp_sql.c | 15 ++++++--------- 3 files changed, 25 insertions(+), 23 deletions(-) (limited to 'scripts') diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index cb5efd0ff9b..bca0581ecbc 100755 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -22,6 +22,7 @@ GET_TARGET_PROPERTY(COMP_SQL_EXE comp_sql LOCATION) ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_SOURCE_DIR}/scripts/mysql_fix_privilege_tables_sql.c COMMAND ${COMP_SQL_EXE} + mysql_fix_privilege_tables mysql_fix_privilege_tables.sql mysql_fix_privilege_tables_sql.c DEPENDS comp_sql ${PROJECT_SOURCE_DIR}/scripts/mysql_fix_privilege_tables.sql) diff --git a/scripts/Makefile.am b/scripts/Makefile.am index e9398fc1a72..79f4666f855 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -15,6 +15,11 @@ ## Process this file with automake to create Makefile.in +BUILT_SOURCES = mysql_fix_privilege_tables.sql \ + mysql_fix_privilege_tables_sql.c + +noinst_PROGRAMS = comp_sql + bin_SCRIPTS = @server_scripts@ \ msql2mysql \ mysql_config \ @@ -94,7 +99,8 @@ CLEANFILES = @server_scripts@ \ mysql_upgrade_shell \ mysqld_multi \ make_win_src_distribution \ - mysql_fix_privilege_tables.sql + mysql_fix_privilege_tables.sql \ + mysql_fix_privilege_tables_sql.c # mysqlbug should be distributed built so that people can report build # failures with it. @@ -111,6 +117,17 @@ mysql_fix_privilege_tables.sql: mysql_system_tables.sql \ @echo "Building $@"; @cat mysql_system_tables.sql mysql_system_tables_fix.sql > $@ +# +# Build mysql_fix_privilege_tables_sql.c from +# mysql_fix_privileges_tables.sql using comp_sql +# +mysql_fix_privilege_tables_sql.c: comp_sql.c mysql_fix_privilege_tables.sql + $(MAKE) $(AM_MAKEFLAGS) comp_sql$(EXEEXT) + $(top_builddir)/scripts/comp_sql$(EXEEXT) \ + mysql_fix_privilege_tables \ + $(top_srcdir)/scripts/mysql_fix_privilege_tables.sql $@ + + SUFFIXES = .sh .sh: @@ -167,18 +184,5 @@ SUFFIXES = .sh @MV@ $@-t $@ -BUILT_SOURCES = mysql_fix_privilege_tables_sql.c -noinst_PROGRAMS = comp_sql - -# -# Build mysql_fix_privilege_tables_sql.c from -# mysql_fix_privileges_tables.sql using comp_sql -# -mysql_fix_privilege_tables_sql.c: comp_sql.c mysql_fix_privilege_tables.sql - $(MAKE) $(AM_MAKEFLAGS) comp_sql$(EXEEXT) - $(top_builddir)/scripts/comp_sql$(EXEEXT) \ - mysql_fix_privilege_tables.sql $@ - - # Don't update the files from bitkeeper %::SCCS/s.% diff --git a/scripts/comp_sql.c b/scripts/comp_sql.c index 53359d384c1..88e88e632b6 100644 --- a/scripts/comp_sql.c +++ b/scripts/comp_sql.c @@ -58,12 +58,12 @@ static void die(const char *fmt, ...) int main(int argc, char *argv[]) { char buff[512]; - char* infile_name= argv[1]; - char* outfile_name= argv[2]; - char* end= infile_name; + char* struct_name= argv[1]; + char* infile_name= argv[2]; + char* outfile_name= argv[3]; - if (argc != 3) - die("Usage: comp_sql "); + if (argc != 4) + die("Usage: comp_sql "); /* Open input and output file */ if (!(in= fopen(infile_name, "r"))) @@ -71,10 +71,7 @@ int main(int argc, char *argv[]) if (!(out= fopen(outfile_name, "w"))) die("Failed to open output file '%s'", outfile_name); - while(*end && *end != '.') - end++; - *end= 0; - fprintf(out, "const char* %s={\n\"", infile_name); + fprintf(out, "const char* %s={\n\"", struct_name); while (fgets(buff, sizeof(buff), in)) { -- cgit v1.2.1