summaryrefslogtreecommitdiff
path: root/sql/ha_innodb.cc
diff options
context:
space:
mode:
authorunknown <gluh@eagle.intranet.mysql.r18.ru>2006-05-02 16:31:39 +0500
committerunknown <gluh@eagle.intranet.mysql.r18.ru>2006-05-02 16:31:39 +0500
commit79cc1546b23f757266dc2f4ed67317865c9d0f2f (patch)
tree87f9c27323eb15913f77d6f3f26d1127bbe46344 /sql/ha_innodb.cc
parentfb2c04a15f6bb4a837e312019e18f881d43bbdd8 (diff)
downloadmariadb-git-79cc1546b23f757266dc2f4ed67317865c9d0f2f.tar.gz
WL#2257 REFERENTIAL_CONSTRAINTS view
added I_S.REFARENTIAL_CONSTRAINTS table mysql-test/r/information_schema.result: WL#2257 REFERENTIAL_CONSTRAINTS view result fix mysql-test/r/information_schema_db.result: WL#2257 REFERENTIAL_CONSTRAINTS view result fix mysql-test/r/information_schema_inno.result: WL#2257 REFERENTIAL_CONSTRAINTS view test case mysql-test/t/information_schema_inno.test: WL#2257 REFERENTIAL_CONSTRAINTS view test case sql/ha_innodb.cc: WL#2257 REFERENTIAL_CONSTRAINTS view
Diffstat (limited to 'sql/ha_innodb.cc')
-rw-r--r--sql/ha_innodb.cc77
1 files changed, 49 insertions, 28 deletions
diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc
index 42def845174..a02361a0eac 100644
--- a/sql/ha_innodb.cc
+++ b/sql/ha_innodb.cc
@@ -5827,34 +5827,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,