Parcourir la source

Column version of table version renamed to table_version to avoid
conflicts, reported by [email protected]

Jan Janak il y a 21 ans
Parent
commit
3cf541aa2d
2 fichiers modifiés avec 9 ajouts et 3 suppressions
  1. 2 2
      config.h
  2. 7 1
      scripts/ser_mysql.sh

+ 2 - 2
config.h

@@ -186,9 +186,9 @@
 #define DEFAULT_RODB_URL "mysql://serro:47serro11@localhost/ser"
 #define DEFAULT_RODB_URL_LEN (sizeof(DEFAULT_RODB_URL) - 1)
 
-/* table holdin versions of other ser tables */
+/* table holding versions of other ser tables */
 #define VERSION_TABLE "version"
-#define VERSION_COLUMN "version"
+#define VERSION_COLUMN "table_version"
 #define TABLENAME_COLUMN "table_name"
 
 /* minimum packet size; smaller packets will be dropped silently */

+ 7 - 1
scripts/ser_mysql.sh

@@ -226,7 +226,7 @@ GRANT SELECT ON $1.* TO ${ROUSER}@$DBHOST IDENTIFIED BY '$RO_PW';
 
 CREATE TABLE version (
    table_name varchar(64) NOT NULL,
-   version smallint(5) DEFAULT '0' NOT NULL
+   table_version smallint(5) DEFAULT '0' NOT NULL
 ) $TABLE_TYPE;
 
 #
@@ -717,12 +717,18 @@ case $1 in
 		fi
 		#5 restoring table content
 		echo "restoring table content"
+
+		# Recreate perms column here so that subsequent
+		# restore succeeds
+		
 		ser_restore $DBNAME ${tmp_file}.2
 		if [ "$?" -ne 0 ] ; then
 			echo "reinstall: restoring table failed"
 			rm $tmp_file*
 			exit 1
 		fi
+		
+		# Drop perms column here
 #XX
 #		rm $tmp_file*
 		exit 0