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

Commita7eba9c

Browse files
committed
DatabaseMetaData.getColumns() doesn't appear to get the default
value for each column. Here is a context diff of CVS which shouldfix it.Jason Davies
1 parenteec08cd commita7eba9c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

‎src/interfaces/jdbc/org/postgresql/jdbc1/DatabaseMetaData.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1936,7 +1936,7 @@ public java.sql.ResultSet getColumns(String catalog, String schemaPattern, Strin
19361936

19371937
// Now form the query
19381938
// Modified by Stefan Andreasen <stefan@linux.kapow.dk>
1939-
r =connection.ExecSQL("select a.oid,c.relname,a.attname,a.atttypid,a.attnum,a.attnotnull,a.attlen,a.atttypmod from pg_class c,pg_attribute awhere a.attrelid=c.oid and c.relname like '"+tableNamePattern.toLowerCase()+"' and a.attname like '"+columnNamePattern.toLowerCase()+"' and a.attnum>0 order by c.relname,a.attnum");
1939+
r =connection.ExecSQL("select a.oid,c.relname,a.attname,a.atttypid,a.attnum,a.attnotnull,a.attlen,a.atttypmod,d.adsrc from pg_class c,pg_attribute a,pg_attrdef dwhere a.attrelid=c.oid and c.relname like '"+tableNamePattern.toLowerCase()+"' and a.attname like '"+columnNamePattern.toLowerCase()+"' and a.attnum>0 and c.oid=d.adrelid and d.adnum=a.attnum order by c.relname,a.attnum");
19401940

19411941
byteremarks[];
19421942

@@ -1983,7 +1983,7 @@ public java.sql.ResultSet getColumns(String catalog, String schemaPattern, Strin
19831983
// tuple[10] is below
19841984
// tuple[11] is above
19851985

1986-
tuple[12] =null;// column default
1986+
tuple[12] =r.getBytes(9);// column default
19871987

19881988
tuple[13] =null;// sql data type (unused)
19891989
tuple[14] =null;// sql datetime sub (unused)

‎src/interfaces/jdbc/org/postgresql/jdbc2/DatabaseMetaData.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1936,7 +1936,7 @@ public java.sql.ResultSet getColumns(String catalog, String schemaPattern, Strin
19361936

19371937
// Now form the query
19381938
// Modified by Stefan Andreasen <stefan@linux.kapow.dk>
1939-
r =connection.ExecSQL("select a.oid,c.relname,a.attname,a.atttypid,a.attnum,a.attnotnull,a.attlen,a.atttypmod from pg_class c,pg_attribute awhere a.attrelid=c.oid and c.relname like '"+tableNamePattern.toLowerCase()+"' and a.attname like '"+columnNamePattern.toLowerCase()+"' and a.attnum>0 order by c.relname,a.attnum");
1939+
r =connection.ExecSQL("select a.oid,c.relname,a.attname,a.atttypid,a.attnum,a.attnotnull,a.attlen,a.atttypmod,d.adsrc from pg_class c,pg_attribute a,pg_attrdef dwhere a.attrelid=c.oid and c.relname like '"+tableNamePattern.toLowerCase()+"' and a.attname like '"+columnNamePattern.toLowerCase()+"' and a.attnum>0 and c.oid=d.adrelid and d.adnum=a.attnum order by c.relname,a.attnum");
19401940

19411941
byteremarks[];
19421942

@@ -1983,7 +1983,7 @@ public java.sql.ResultSet getColumns(String catalog, String schemaPattern, Strin
19831983
// tuple[10] is below
19841984
// tuple[11] is above
19851985

1986-
tuple[12] =null;// column default
1986+
tuple[12] =r.getBytes(9);// column default
19871987

19881988
tuple[13] =null;// sql data type (unused)
19891989
tuple[14] =null;// sql datetime sub (unused)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp