Description: Since SQL installations and upgrade are handled by dbconfig and
 these scripts provided by upstream are simply processed and installed for
 dbconfig, the USE statement they include needs to be dropped. dbconfig keeps
 track of what database the user uses.
Author: Jan Hauke Rahm <jhr@debian.org>
Reviewed-by: Alexander Golovko <alexandro@ankalagon.ru>
Last-Update: 2012-06-02

--- a/src/cats/make_mysql_tables.in
+++ b/src/cats/make_mysql_tables.in
@@ -11,7 +11,6 @@ PATH="$bindir:$PATH"
 db_name=${db_name:-@db_name@}
 
 if mysql $* -f <<END-OF-DATA
-USE ${db_name};
 --
 -- Note, we use BLOB rather than TEXT because in MySQL,
 --  BLOBs are identical to TEXT except that BLOB is case
--- a/src/cats/update_mysql_tables.in
+++ b/src/cats/update_mysql_tables.in
@@ -22,8 +22,6 @@ if [ $DBVERSION != 12 ] ; then
 fi
 
 if mysql $* -f <<END-OF-DATA
-USE ${db_name};
-
 CREATE TABLE RestoreObject (
    RestoreObjectId INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
    ObjectName BLOB NOT NULL,
--- a/updatedb/update_mysql_tables_10_to_11.in
+++ b/updatedb/update_mysql_tables_10_to_11.in
@@ -11,8 +11,6 @@ PATH="$bindir:$PATH"
 db_name=${db_name:-@db_name@}
 
 if mysql $* -f <<END-OF-DATA
-USE ${db_name};
-
 -- Fix bad index on Media table
 DROP INDEX inx8 ON Media;
 CREATE UNIQUE INDEX inx8 ON Media (VolumeName(128));
--- a/updatedb/update_mysql_tables_11_to_12.in
+++ b/updatedb/update_mysql_tables_11_to_12.in
@@ -22,8 +22,6 @@ if [ $DBVERSION != 11 ] ; then
 fi
 
 if mysql $* -f <<END-OF-DATA
-USE ${db_name};
-
 ALTER TABLE JobMedia DROP Stripe ;
 ALTER TABLE JobMedia DROP Copy ;
 ALTER TABLE Job ADD COLUMN HasCache tinyint default 0 after HasBase;
--- a/updatedb/update_mysql_tables_12_to_14.in
+++ b/updatedb/update_mysql_tables_12_to_14.in
@@ -22,8 +22,6 @@ if [ $DBVERSION != 12 ] ; then
 fi
 
 if mysql $* -f <<END-OF-DATA
-USE ${db_name};
-
 CREATE TABLE RestoreObject (
    RestoreObjectId INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
    ObjectName BLOB NOT NULL,
