mariadb/client
Ramil Kalimullin 53e42d9ee4 Fix for
bug#33094: Error in upgrading from 5.0 to 5.1 when table contains
triggers
and
#41385: Crash when attempting to repair a #mysql50# upgraded table
with triggers.

Problem:
1. trigger code didn't assume a table name may have
a "#mysql50#" prefix, that may lead to a failing ASSERT().
2. "ALTER DATABASE ... UPGRADE DATA DIRECTORY NAME" failed
for databases with "#mysql50#" prefix if any trigger.
3. mysqlcheck --fix-table-name didn't use UTF8 as a default
character set that resulted in (parsing) errors for tables with
non-latin symbols in their names and definitions of triggers.

Fix:
1. properly handle table/database names with "#mysql50#" prefix.
2. handle --default-character-set mysqlcheck option;
if mysqlcheck is launched with --fix-table-name or --fix-db-name
set default character set to UTF8 if no --default-character-set
option given.

Note: if given --fix-table-name or --fix-db-name option,
without --default-character-set mysqlcheck option
default character set is UTF8.


client/mysqlcheck.c:
  Fix for
  bug#33094: Error in upgrading from 5.0 to 5.1 when table contains
  triggers
  and
  #41385: Crash when attempting to repair a #mysql50# upgraded table
  with triggers.
    - check and set default charset if --default-character-set option
      given.
    - set default charset to "utf8" if there's
      --fix-table-name or --fix-db-name and no --default-character-set.
mysql-test/r/mysqlcheck.result:
  Fix for
  bug#33094: Error in upgrading from 5.0 to 5.1 when table contains
  triggers
  and
  #41385: Crash when attempting to repair a #mysql50# upgraded table
  with triggers.
    - test result.
mysql-test/t/mysqlcheck.test:
  Fix for
  bug#33094: Error in upgrading from 5.0 to 5.1 when table contains
  triggers
  and
  #41385: Crash when attempting to repair a #mysql50# upgraded table
  with triggers.
    - test case.
sql/mysql_priv.h:
  Fix for
  bug#33094: Error in upgrading from 5.0 to 5.1 when table contains
  triggers
  and
  #41385: Crash when attempting to repair a #mysql50# upgraded table
  with triggers.
    - check_n_cut_mysql50_prefix() introduced.
sql/sql_table.cc:
  Fix for
  bug#33094: Error in upgrading from 5.0 to 5.1 when table contains
  triggers
  and
  #41385: Crash when attempting to repair a #mysql50# upgraded table
  with triggers.
    - tablename_to_filename() code split into 2 parts
    - check_n_cut_mysql50_prefix() introduced to cut #mysql50# prefixes,
      used in the trigger code as well.
sql/sql_trigger.cc:
  Fix for
  bug#33094: Error in upgrading from 5.0 to 5.1 when table contains
  triggers
  and
  #41385: Crash when attempting to repair a #mysql50# upgraded table
  with triggers.
    - Table_triggers_list::check_n_load() - checking triggers assume
      a table/database name given may have "#mysql50#" prefix in some cases.
    - Table_triggers_list::change_table_name_in_triggers() -
      create .TRG file in new database directory and delete it in old one,
      as they may differ in case of
      "ALTER DATABASE ... UPGRADE DATA DIRECTORY NAME"
    - Table_triggers_list::change_table_name_in_trignames() - remove stale .TRN
      files in #mysql50#dbname directory in case of database upgrade
    - Table_triggers_list::change_table_name() - allow changing trigger's
      database in case of its upgrading
sql/sql_trigger.h:
  Fix for
  bug#33094: Error in upgrading from 5.0 to 5.1 when table contains
  triggers
  and
  #41385: Crash when attempting to repair a #mysql50# upgraded table
  with triggers.
    - new old_db_name parameter added in
      Table_triggers_list::change_table_name_in_trignames() and
      Table_triggers_list::change_table_name_in_triggers()
2009-01-14 18:50:51 +04:00
..
.cvsignore
client_priv.h Merge dl145h.mysql.com:/data0/mkindahl/mysql-5.1 2008-01-31 17:46:50 +01:00
CMakeLists.txt Bug#37003 Tests sporadically crashes with embedded server 2008-06-18 13:17:15 -03:00
completion_hash.cc WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
completion_hash.h my_strtoll10-x86.s: 2006-12-31 01:02:27 +01:00
echo.c echo.c: 2007-03-20 18:31:49 +01:00
get_password.c fixes for build failures due to my yesterday's changeset forbidding 2008-02-19 18:45:11 +01:00
Makefile.am Bug#31455 mysqlbinlog don't print user readable info about RBR events 2008-08-20 19:06:31 +05:00
my_readline.h WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
mysql.cc merged 5.1-main -> 5.1-bugteam 2009-01-05 18:10:20 +02:00
mysql_upgrade.c Bug#35934 mysql_upgrade calls mysqlcheck with insufficient parameters 2008-12-09 12:30:49 +04:00
mysqladmin.cc Changes of copyright output from "--version" and similar. 2008-11-14 17:29:38 +01:00
mysqlbinlog.cc Additional fix for bug#31455 (rpl decoder) 2008-08-21 16:47:23 +05:00
mysqlcheck.c Fix for 2009-01-14 18:50:51 +04:00
mysqldump.c Added "Sun Microsystems, Inc." to copyright headers on files modified 2008-11-10 21:21:49 +01:00
mysqlimport.c Changes of copyright output from "--version" and similar. 2008-11-14 17:29:38 +01:00
mysqlshow.c Changes of copyright output from "--version" and similar. 2008-11-14 17:29:38 +01:00
mysqlslap.c mysql-test/r/partition.result 2008-11-25 03:04:58 +01:00
mysqltest.c merged 5.0-bugteam -> 5.1-bugteam 2009-01-09 20:35:02 +02:00
readline.cc WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
sql_string.cc Fixed a lot of compiler warnings and errors detected by Forte C++ on Solaris 2007-08-13 16:11:25 +03:00
sql_string.h Fixed compiler warnings 2007-02-23 13:13:55 +02:00