components/openstack/glance/files/glance-upgrade
branchs11u2-sru
changeset 4218 94c0a1195837
parent 4216 27e9e7478812
child 4380 2ac4d1fcad4a
equal deleted inserted replaced
4217:631d20122b9c 4218:94c0a1195837
   115         print ("Please verify MySQL is properly configured and online "
   115         print ("Please verify MySQL is properly configured and online "
   116                "before using svcadm(1M) to clear this service.")
   116                "before using svcadm(1M) to clear this service.")
   117         sys.exit(smf_include.SMF_EXIT_ERR_FATAL)
   117         sys.exit(smf_include.SMF_EXIT_ERR_FATAL)
   118 
   118 
   119     cursor = db.cursor()
   119     cursor = db.cursor()
   120     cursor.execute("SET foreign_key_checks = 0")
       
   121     cursor.execute("ALTER DATABASE %s CHARACTER SET = 'utf8'" %
   120     cursor.execute("ALTER DATABASE %s CHARACTER SET = 'utf8'" %
   122                    engine.url.database)
   121                    engine.url.database)
   123     cursor.execute("ALTER DATABASE %s COLLATE = 'utf8_general_ci'" %
   122     cursor.execute("ALTER DATABASE %s COLLATE = 'utf8_general_ci'" %
   124                    engine.url.database)
   123                    engine.url.database)
   125     cursor.execute("SET foreign_key_checks = 1")
       
   126     cursor.execute("SHOW tables")
   124     cursor.execute("SHOW tables")
   127     res = cursor.fetchall()
   125     res = cursor.fetchall()
   128     if res:
   126     if res:
   129         cursor.execute("SET foreign_key_checks = 0")
   127         cursor.execute("SET foreign_key_checks = 0")
   130         for item in res:
   128         for item in res: