Modified:
branches/guffert/driver/catalog.c
branches/guffert/test/my_catalog.c
Log:
Add missing pieces from SQLForeignKeys() patch
Modified: branches/guffert/driver/catalog.c
===================================================================
--- branches/guffert/driver/catalog.c 2008-01-05 00:17:04 UTC (rev 992)
+++ branches/guffert/driver/catalog.c 2008-01-08 21:33:00 UTC (rev 993)
@@ -1734,7 +1734,7 @@
" WHEN R.UPDATE_RULE = 'SET DEFAULT' THEN 4"
" WHEN R.UPDATE_RULE = 'SET RESTRICT' THEN 1"
" WHEN R.UPDATE_RULE = 'SET NO ACTION' THEN 3"
- " ELSE "
+ " ELSE 3"
" END";
delete_rule= "CASE"
" WHEN R.DELETE_RULE = 'CASCADE' THEN 0"
@@ -1742,7 +1742,7 @@
" WHEN R.DELETE_RULE = 'SET DEFAULT' THEN 4"
" WHEN R.DELETE_RULE = 'SET RESTRICT' THEN 1"
" WHEN R.DELETE_RULE = 'SET NO ACTION' THEN 3"
- " ELSE "
+ " ELSE 3"
" END";
ref_constraints_join=
@@ -1774,7 +1774,7 @@
"(SELECT CONSTRAINT_NAME FROM"
" INFORMATION_SCHEMA.TABLE_CONSTRAINTS"
" WHERE TABLE_SCHEMA = REFERENCED_TABLE_SCHEMA AND"
- " TABLE_NAME = REFERENCED_TABLE_NAME AND"
+ " TABLE_NAME = A.REFERENCED_TABLE_NAME AND"
" CONSTRAINT_TYPE IN ('UNIQUE','PRIMARY KEY') LIMIT 1)"
" AS PK_NAME,"
"7 AS DEFERRABILITY"
Modified: branches/guffert/test/my_catalog.c
===================================================================
--- branches/guffert/test/my_catalog.c 2008-01-05 00:17:04 UTC (rev 992)
+++ branches/guffert/test/my_catalog.c 2008-01-08 21:33:00 UTC (rev 993)
@@ -806,7 +806,7 @@
is_str(my_fetch_str(hstmt, buff, 8), "parent_id", 9);
if (mysql_min_version(hdbc, "5.1", 3))
{
- is_num(my_fetch_int(hstmt, 10), SQL_RESTRICT);
+ is_num(my_fetch_int(hstmt, 10), SQL_NO_ACTION);
is_num(my_fetch_int(hstmt, 11), SQL_SET_NULL);
}
else
@@ -835,8 +835,8 @@
is_str(my_fetch_str(hstmt, buff, 8), "parent_id", 9);
if (mysql_min_version(hdbc, "5.1", 3))
{
- is_num(my_fetch_int(hstmt, 10), SQL_CASCADE);
- is_num(my_fetch_int(hstmt, 11), SQL_NO_ACTION);
+ is_num(my_fetch_int(hstmt, 10), SQL_NO_ACTION);
+ is_num(my_fetch_int(hstmt, 11), SQL_CASCADE);
}
ok_stmt(hstmt, SQLFreeStmt(hstmt, SQL_CLOSE));
@@ -1164,7 +1164,6 @@
ok_sql(hstmt, "CREATE TABLE t_bug19923b (b INT PRIMARY KEY) ENGINE=InnoDB");
ok_sql(hstmt, "CREATE TABLE t_bug19923c (a INT, b INT, UNIQUE(a), UNIQUE(b), CONSTRAINT
`first_constraint` FOREIGN KEY (`b`) REFERENCES `t_bug19923b` (`b`), CONSTRAINT
`second_constraint` FOREIGN KEY (`a`) REFERENCES `t_bug19923a` (`a`)) ENGINE=InnoDB");
-
ok_stmt(hstmt, SQLForeignKeys(hstmt, NULL, 0, NULL, 0, NULL, 0, NULL, 0,
NULL, 0, (SQLCHAR *)"t_bug19923c", SQL_NTS));
| Thread |
|---|
| • Connector/ODBC 3.51 commit: r993 - in branches/guffert: driver test | jwinstead | 8 Jan |