Jens Glaser found that getPrimaryKeys() had a table called test hardwired

into it.
This commit is contained in:
Peter Mount 1999-09-15 21:12:34 +00:00
parent cd68ecfef6
commit 8363e137aa
2 changed files with 30 additions and 28 deletions

View File

@ -2158,13 +2158,14 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
"a.attname AS COLUMN_NAME," +
"a.attnum as KEY_SEQ,"+
"ic.relname as PK_NAME " +
" from pg_class bc, pg_class ic, pg_index i, pg_attribute a, pg_type t" +
" where bc.relkind = 'r'"+
" and upper(bc.relname) = upper('test')" +
" FROM pg_class bc, pg_class ic, pg_index i, pg_attribute a" +
" WHERE bc.relkind = 'r' " + // -- not indices
" and upper(bc.relname) = upper('"+table+"')" +
" and i.indrelid = bc.oid" +
" and i.indexrelid = ic.oid and a.attrelid = ic.oid"+
" and i.indexrelid = ic.oid" +
" and ic.oid = a.attrelid" +
" and i.indisprimary='t' " +
" order by table_name, pk_name,key_seq;"
" ORDER BY table_name, pk_name, key_seq"
);
}

View File

@ -2158,13 +2158,14 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
"a.attname AS COLUMN_NAME," +
"a.attnum as KEY_SEQ,"+
"ic.relname as PK_NAME " +
" from pg_class bc, pg_class ic, pg_index i, pg_attribute a, pg_type t" +
" where bc.relkind = 'r'"+
" and upper(bc.relname) = upper('test')" +
" FROM pg_class bc, pg_class ic, pg_index i, pg_attribute a" +
" WHERE bc.relkind = 'r' " + // -- not indices
" and upper(bc.relname) = upper('"+table+"')" +
" and i.indrelid = bc.oid" +
" and i.indexrelid = ic.oid and a.attrelid = ic.oid"+
" and i.indexrelid = ic.oid" +
" and ic.oid = a.attrelid" +
" and i.indisprimary='t' " +
" order by table_name, pk_name,key_seq;"
" ORDER BY table_name, pk_name, key_seq"
);
}