Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitedfca4b

Browse files
committed
Subject: Bug in SQLForeignKeys()
Query used for checking foreign key triggersreturns too many results when there're more than one foreignkey in a table. It happens because only table's oid is used tolink between pg_trigger with INSERT check and pg_trigger withUPDATE/DELETE check.I think there should be enough to add following conditionsinto WHERE clause of that query: AND pt.tgconstrname = pg_trigger.tgconstrname AND pt.tgconstrname = pg_trigger_1.tgconstrname/Constantin
1 parent3de8407 commitedfca4b

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

‎src/interfaces/odbc/info.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2368,7 +2368,9 @@ Int2 result_cols;
23682368
"AND (pg_proc.proname LIKE '%%upd') "
23692369
"AND (pg_proc_1.proname LIKE '%%del') "
23702370
"AND (pg_trigger.tgrelid=pt.tgconstrrelid) "
2371-
"AND (pg_trigger_1.tgrelid = pt.tgconstrrelid))",
2371+
"AND (pg_trigger.tgconstrname=pt.tgconstrname) "
2372+
"AND (pg_trigger_1.tgrelid=pt.tgconstrrelid) "
2373+
"AND (pg_trigger_1.tgconstrname=pt.tgconstrname))",
23722374
fk_table_needed);
23732375

23742376
result=SQLExecDirect(htbl_stmt,tables_query,strlen(tables_query));

‎src/interfaces/odbc/pgtypes.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,9 @@ Int2 pgtype_to_sqltype(StatementClass *stmt, Int4 type)
217217
casePG_TYPE_XID:
218218
casePG_TYPE_INT4:returnSQL_INTEGER;
219219

220-
casePG_TYPE_INT8:returnSQL_BIGINT;
220+
/* Change this to SQL_BIGINT for ODBC v3 bjm 2001-01-23 */
221+
casePG_TYPE_INT8:returnSQL_CHAR;
222+
221223
casePG_TYPE_NUMERIC:returnSQL_NUMERIC;
222224

223225
casePG_TYPE_FLOAT4:returnSQL_REAL;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp