diff options
author | unknown <acurtis@xiphis.org> | 2006-05-03 15:58:12 -0700 |
---|---|---|
committer | unknown <acurtis@xiphis.org> | 2006-05-03 15:58:12 -0700 |
commit | fff659234f45c1c56e3ddc4c914bea669e9e6eb4 (patch) | |
tree | 14064ccccc5110914ded532a037702be7b41c346 /sql/ha_innodb.cc | |
parent | 7f6a9906bcbf8b97b59431d6f99bc7c366dd96e0 (diff) | |
parent | c49687f3ce04d9ea87166ce692a75945871a14cd (diff) | |
download | mariadb-git-fff659234f45c1c56e3ddc4c914bea669e9e6eb4.tar.gz |
Merge acurtis@bk-internal:/home/bk/mysql-5.1-new
into xiphis.org:/home/antony/work2/wl3201-final
sql/ha_innodb.cc:
Auto merged
sql/sql_show.cc:
Auto merged
Diffstat (limited to 'sql/ha_innodb.cc')
-rw-r--r-- | sql/ha_innodb.cc | 77 |
1 files changed, 49 insertions, 28 deletions
diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index ad7c5fd2c0e..3f606cd0b15 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -5832,34 +5832,55 @@ ha_innobase::get_foreign_key_list(THD *thd, List<FOREIGN_KEY_INFO> *f_key_list) break; } - ulong length= 0; - if (foreign->type == DICT_FOREIGN_ON_DELETE_CASCADE) { - length=17; - tmp_buff= "ON DELETE CASCADE"; - } - else if (foreign->type == DICT_FOREIGN_ON_DELETE_SET_NULL) { - length=18; - tmp_buff= "ON DELETE SET NULL"; - } - else if (foreign->type == DICT_FOREIGN_ON_DELETE_NO_ACTION) { - length=19; - tmp_buff= "ON DELETE NO ACTION"; - } - else if (foreign->type == DICT_FOREIGN_ON_UPDATE_CASCADE) { - length=17; - tmp_buff= "ON UPDATE CASCADE"; - } - else if (foreign->type == DICT_FOREIGN_ON_UPDATE_SET_NULL) { - length=18; - tmp_buff= "ON UPDATE SET NULL"; - } - else if (foreign->type == DICT_FOREIGN_ON_UPDATE_NO_ACTION) { - length=19; - tmp_buff= "ON UPDATE NO ACTION"; - } - f_key_info.constraint_method= make_lex_string(thd, - f_key_info.constraint_method, - tmp_buff, length, 1); + ulong length; + if (foreign->type & DICT_FOREIGN_ON_DELETE_CASCADE) + { + length=7; + tmp_buff= "CASCADE"; + } + else if (foreign->type & DICT_FOREIGN_ON_DELETE_SET_NULL) + { + length=8; + tmp_buff= "SET NULL"; + } + else if (foreign->type & DICT_FOREIGN_ON_DELETE_NO_ACTION) + { + length=9; + tmp_buff= "NO ACTION"; + } + else + { + length=8; + tmp_buff= "RESTRICT"; + } + f_key_info.delete_method= make_lex_string(thd, f_key_info.delete_method, + tmp_buff, length, 1); + + + if (foreign->type & DICT_FOREIGN_ON_UPDATE_CASCADE) + { + length=7; + tmp_buff= "CASCADE"; + } + else if (foreign->type & DICT_FOREIGN_ON_UPDATE_SET_NULL) + { + length=8; + tmp_buff= "SET NULL"; + } + else if (foreign->type & DICT_FOREIGN_ON_UPDATE_NO_ACTION) + { + length=9; + tmp_buff= "NO ACTION"; + } + else + { + length=8; + tmp_buff= "RESTRICT"; + } + f_key_info.update_method= make_lex_string(thd, f_key_info.update_method, + tmp_buff, length, 1); + + FOREIGN_KEY_INFO *pf_key_info= ((FOREIGN_KEY_INFO *) thd->memdup((gptr) &f_key_info, |