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

Commit62da2fa

Browse files
author
Barry Lind
committed
Fixed DatabaseMetaData to correctly handle NAME size of 64
Fixed Statement to correctly DEALLOCATE any prepared statements Modified Files: jdbc/org/postgresql/PGStatement.java jdbc/org/postgresql/jdbc1/AbstractJdbc1DatabaseMetaData.java jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java
1 parent24507ac commit62da2fa

File tree

3 files changed

+134
-95
lines changed

3 files changed

+134
-95
lines changed

‎src/interfaces/jdbc/org/postgresql/PGStatement.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
importjava.sql.*;
55

6-
/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/Attic/PGStatement.java,v 1.5 2002/09/06 21:23:05 momjian Exp $
6+
/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/Attic/PGStatement.java,v 1.6 2002/09/08 00:15:28 barry Exp $
77
* This interface defines PostgreSQL extentions to the java.sql.Statement interface.
88
* Any java.sql.Statement object returned by the driver will also implement this
99
* interface
@@ -18,7 +18,7 @@ public interface PGStatement
1818
*/
1919
publiclonggetLastOID()throwsSQLException;
2020

21-
publicvoidsetUseServerPrepare(booleanflag);
21+
publicvoidsetUseServerPrepare(booleanflag)throwsSQLException;
2222

2323
publicbooleanisUseServerPrepare();
2424

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

Lines changed: 88 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,20 @@ public abstract class AbstractJdbc1DatabaseMetaData
2727
protectedstaticfinalintiInt2Oid =21;// OID for int2
2828
protectedstaticfinalintiInt4Oid =23;// OID for int4
2929
protectedstaticfinalintVARHDRSZ =4;// length for int4
30+
protectedstaticintNAME_SIZE =64;// length for name datatype
3031

3132
publicAbstractJdbc1DatabaseMetaData(AbstractJdbc1Connectionconn)
3233
{
3334
this.connection =conn;
35+
try {
36+
if (connection.haveMinimumServerVersion("7.3")) {
37+
NAME_SIZE =64;
38+
}else {
39+
NAME_SIZE =32;
40+
}
41+
}catch (SQLExceptionl_se) {
42+
//leave value at default
43+
}
3444
}
3545

3646
/*
@@ -1290,16 +1300,14 @@ public int getMaxCharLiteralLength() throws SQLException
12901300
}
12911301

12921302
/*
1293-
* Whats the limit on column name length. The description of
1294-
* pg_class would say '32' (length of pg_class.relname) - we
1295-
* should probably do a query for this....but....
1303+
* Whats the limit on column name length.
12961304
*
12971305
* @return the maximum column name length
12981306
* @exception SQLException if a database access error occurs
12991307
*/
13001308
publicintgetMaxColumnNameLength()throwsSQLException
13011309
{
1302-
return32;
1310+
returnNAME_SIZE;
13031311
}
13041312

13051313
/*
@@ -1383,15 +1391,14 @@ public int getMaxConnections() throws SQLException
13831391
}
13841392

13851393
/*
1386-
* What is the maximum cursor name length (the same as all
1387-
* the other F***** identifiers!)
1394+
* What is the maximum cursor name length
13881395
*
13891396
* @return max cursor name length in bytes
13901397
* @exception SQLException if a database access error occurs
13911398
*/
13921399
publicintgetMaxCursorNameLength()throwsSQLException
13931400
{
1394-
return32;
1401+
returnNAME_SIZE;
13951402
}
13961403

13971404
/*
@@ -1415,16 +1422,14 @@ public int getMaxSchemaNameLength() throws SQLException
14151422
}
14161423

14171424
/*
1418-
* What is the maximum length of a procedure name?
1419-
* (length of pg_proc.proname used) - again, I really
1420-
* should do a query here to get it.
1425+
* What is the maximum length of a procedure name
14211426
*
14221427
* @return the max name length in bytes
14231428
* @exception SQLException if a database access error occurs
14241429
*/
14251430
publicintgetMaxProcedureNameLength()throwsSQLException
14261431
{
1427-
return32;
1432+
returnNAME_SIZE;
14281433
}
14291434

14301435
publicintgetMaxCatalogNameLength()throwsSQLException
@@ -1490,15 +1495,14 @@ public int getMaxStatements() throws SQLException
14901495
}
14911496

14921497
/*
1493-
* What is the maximum length of a table name?This was found
1494-
* from pg_class.relname length
1498+
* What is the maximum length of a table name
14951499
*
14961500
* @return max name length in bytes
14971501
* @exception SQLException if a database access error occurs
14981502
*/
14991503
publicintgetMaxTableNameLength()throwsSQLException
15001504
{
1501-
return32;
1505+
returnNAME_SIZE;
15021506
}
15031507

15041508
/*
@@ -1514,17 +1518,14 @@ public int getMaxTablesInSelect() throws SQLException
15141518
}
15151519

15161520
/*
1517-
* What is the maximum length of a user name? Well, we generally
1518-
* use UNIX like user names in PostgreSQL, so I think this would
1519-
* be 8. However, showing the schema for pg_user shows a length
1520-
* for username of 32.
1521+
* What is the maximum length of a user name
15211522
*
15221523
* @return the max name length in bytes
15231524
* @exception SQLException if a database access error occurs
15241525
*/
15251526
publicintgetMaxUserNameLength()throwsSQLException
15261527
{
1527-
return32;
1528+
returnNAME_SIZE;
15281529
}
15291530

15301531

@@ -1671,10 +1672,10 @@ public java.sql.ResultSet getProcedures(String catalog, String schemaPattern, St
16711672
java.sql.ResultSetr;// ResultSet for the SQL query that we need to do
16721673
Vectorv =newVector();// The new ResultSet tuple stuff
16731674

1674-
f[0] =newField(connection,"PROCEDURE_CAT",iVarcharOid,32);
1675-
f[1] =newField(connection,"PROCEDURE_SCHEM",iVarcharOid,32);
1676-
f[2] =newField(connection,"PROCEDURE_NAME",iVarcharOid,32);
1677-
f[3] =f[4] =f[5] =newField(connection,"reserved",iVarcharOid,32);// null;// reserved, must be null for now
1675+
f[0] =newField(connection,"PROCEDURE_CAT",iVarcharOid,NAME_SIZE);
1676+
f[1] =newField(connection,"PROCEDURE_SCHEM",iVarcharOid,NAME_SIZE);
1677+
f[2] =newField(connection,"PROCEDURE_NAME",iVarcharOid,NAME_SIZE);
1678+
f[3] =f[4] =f[5] =newField(connection,"reserved",iVarcharOid,NAME_SIZE);// null;// reserved, must be null for now
16781679
f[6] =newField(connection,"REMARKS",iVarcharOid,8192);
16791680
f[7] =newField(connection,"PROCEDURE_TYPE",iInt2Oid,2);
16801681

@@ -1763,19 +1764,19 @@ public java.sql.ResultSet getProcedureColumns(String catalog, String schemaPatte
17631764
ResultSetr;// ResultSet for the SQL query that we need to do
17641765
Vectorv =newVector();// The new ResultSet tuple stuff
17651766

1766-
f[0] =newField(connection,"PROCEDURE_CAT",iVarcharOid,32);
1767-
f[1] =newField(connection,"PROCEDURE_SCHEM",iVarcharOid,32);
1768-
f[2] =newField(connection,"PROCEDURE_NAME",iVarcharOid,32);
1769-
f[3] =newField(connection,"COLUMN_NAME",iVarcharOid,32);
1767+
f[0] =newField(connection,"PROCEDURE_CAT",iVarcharOid,NAME_SIZE);
1768+
f[1] =newField(connection,"PROCEDURE_SCHEM",iVarcharOid,NAME_SIZE);
1769+
f[2] =newField(connection,"PROCEDURE_NAME",iVarcharOid,NAME_SIZE);
1770+
f[3] =newField(connection,"COLUMN_NAME",iVarcharOid,NAME_SIZE);
17701771
f[4] =newField(connection,"COLUMN_TYPE",iInt2Oid,2);
17711772
f[5] =newField(connection,"DATA_TYPE",iInt2Oid,2);
1772-
f[6] =newField(connection,"TYPE_NAME",iVarcharOid,32);
1773+
f[6] =newField(connection,"TYPE_NAME",iVarcharOid,NAME_SIZE);
17731774
f[7] =newField(connection,"PRECISION",iInt4Oid,4);
17741775
f[8] =newField(connection,"LENGTH",iInt4Oid,4);
17751776
f[9] =newField(connection,"SCALE",iInt2Oid,2);
17761777
f[10] =newField(connection,"RADIX",iInt2Oid,2);
17771778
f[11] =newField(connection,"NULLABLE",iInt2Oid,2);
1778-
f[12] =newField(connection,"REMARKS",iVarcharOid,32);
1779+
f[12] =newField(connection,"REMARKS",iVarcharOid,NAME_SIZE);
17791780

17801781
// add query loop here
17811782

@@ -1828,11 +1829,11 @@ public java.sql.ResultSet getTables(String catalog, String schemaPattern, String
18281829
java.sql.ResultSetr;// ResultSet for the SQL query that we need to do
18291830
Vectorv =newVector();// The new ResultSet tuple stuff
18301831

1831-
f[0] =newField(connection,"TABLE_CAT",iVarcharOid,32);
1832-
f[1] =newField(connection,"TABLE_SCHEM",iVarcharOid,32);
1833-
f[2] =newField(connection,"TABLE_NAME",iVarcharOid,32);
1834-
f[3] =newField(connection,"TABLE_TYPE",iVarcharOid,32);
1835-
f[4] =newField(connection,"REMARKS",iVarcharOid,32);
1832+
f[0] =newField(connection,"TABLE_CAT",iVarcharOid,NAME_SIZE);
1833+
f[1] =newField(connection,"TABLE_SCHEM",iVarcharOid,NAME_SIZE);
1834+
f[2] =newField(connection,"TABLE_NAME",iVarcharOid,NAME_SIZE);
1835+
f[3] =newField(connection,"TABLE_TYPE",iVarcharOid,NAME_SIZE);
1836+
f[4] =newField(connection,"REMARKS",iVarcharOid,NAME_SIZE);
18361837

18371838
// Now form the query
18381839
StringBuffersql =newStringBuffer("select relname,oid,relkind from pg_class where (");
@@ -1958,7 +1959,7 @@ public java.sql.ResultSet getSchemas() throws SQLException
19581959
Fieldf[] =newField[1];
19591960
Vectorv =newVector();
19601961
byte[][]tuple =newbyte[1][0];
1961-
f[0] =newField(connection,"TABLE_SCHEM",iVarcharOid,32);
1962+
f[0] =newField(connection,"TABLE_SCHEM",iVarcharOid,NAME_SIZE);
19621963
tuple[0] ="".getBytes();
19631964
v.addElement(tuple);
19641965
returnconnection.getResultSet(null,f,v,"OK",1);
@@ -1999,7 +2000,7 @@ public java.sql.ResultSet getTableTypes() throws SQLException
19992000
{
20002001
Fieldf[] =newField[1];
20012002
Vectorv =newVector();
2002-
f[0] =newField(connection,newString("TABLE_TYPE"),iVarcharOid,32);
2003+
f[0] =newField(connection,newString("TABLE_TYPE"),iVarcharOid,NAME_SIZE);
20032004
for (inti =0;i <getTableTypes.length;i++)
20042005
{
20052006
byte[][]tuple =newbyte[1][0];
@@ -2062,24 +2063,24 @@ public java.sql.ResultSet getColumns(String catalog, String schemaPattern, Strin
20622063
Vectorv =newVector();// The new ResultSet tuple stuff
20632064
Fieldf[] =newField[18];// The field descriptors for the new ResultSet
20642065

2065-
f[0] =newField(connection,"TABLE_CAT",iVarcharOid,32);
2066-
f[1] =newField(connection,"TABLE_SCHEM",iVarcharOid,32);
2067-
f[2] =newField(connection,"TABLE_NAME",iVarcharOid,32);
2068-
f[3] =newField(connection,"COLUMN_NAME",iVarcharOid,32);
2066+
f[0] =newField(connection,"TABLE_CAT",iVarcharOid,NAME_SIZE);
2067+
f[1] =newField(connection,"TABLE_SCHEM",iVarcharOid,NAME_SIZE);
2068+
f[2] =newField(connection,"TABLE_NAME",iVarcharOid,NAME_SIZE);
2069+
f[3] =newField(connection,"COLUMN_NAME",iVarcharOid,NAME_SIZE);
20692070
f[4] =newField(connection,"DATA_TYPE",iInt2Oid,2);
2070-
f[5] =newField(connection,"TYPE_NAME",iVarcharOid,32);
2071+
f[5] =newField(connection,"TYPE_NAME",iVarcharOid,NAME_SIZE);
20712072
f[6] =newField(connection,"COLUMN_SIZE",iInt4Oid,4);
2072-
f[7] =newField(connection,"BUFFER_LENGTH",iVarcharOid,32);
2073+
f[7] =newField(connection,"BUFFER_LENGTH",iVarcharOid,NAME_SIZE);
20732074
f[8] =newField(connection,"DECIMAL_DIGITS",iInt4Oid,4);
20742075
f[9] =newField(connection,"NUM_PREC_RADIX",iInt4Oid,4);
20752076
f[10] =newField(connection,"NULLABLE",iInt4Oid,4);
2076-
f[11] =newField(connection,"REMARKS",iVarcharOid,32);
2077-
f[12] =newField(connection,"COLUMN_DEF",iVarcharOid,32);
2077+
f[11] =newField(connection,"REMARKS",iVarcharOid,NAME_SIZE);
2078+
f[12] =newField(connection,"COLUMN_DEF",iVarcharOid,NAME_SIZE);
20782079
f[13] =newField(connection,"SQL_DATA_TYPE",iInt4Oid,4);
20792080
f[14] =newField(connection,"SQL_DATETIME_SUB",iInt4Oid,4);
2080-
f[15] =newField(connection,"CHAR_OCTET_LENGTH",iVarcharOid,32);
2081+
f[15] =newField(connection,"CHAR_OCTET_LENGTH",iVarcharOid,NAME_SIZE);
20812082
f[16] =newField(connection,"ORDINAL_POSITION",iInt4Oid,4);
2082-
f[17] =newField(connection,"IS_NULLABLE",iVarcharOid,32);
2083+
f[17] =newField(connection,"IS_NULLABLE",iVarcharOid,NAME_SIZE);
20832084

20842085
StringBuffersql =newStringBuffer(512);
20852086

@@ -2245,14 +2246,14 @@ public java.sql.ResultSet getColumnPrivileges(String catalog, String schema, Str
22452246
else
22462247
columnNamePattern =columnNamePattern.toLowerCase();
22472248

2248-
f[0] =newField(connection,"TABLE_CAT",iVarcharOid,32);
2249-
f[1] =newField(connection,"TABLE_SCHEM",iVarcharOid,32);
2250-
f[2] =newField(connection,"TABLE_NAME",iVarcharOid,32);
2251-
f[3] =newField(connection,"COLUMN_NAME",iVarcharOid,32);
2252-
f[4] =newField(connection,"GRANTOR",iVarcharOid,32);
2253-
f[5] =newField(connection,"GRANTEE",iVarcharOid,32);
2254-
f[6] =newField(connection,"PRIVILEGE",iVarcharOid,32);
2255-
f[7] =newField(connection,"IS_GRANTABLE",iVarcharOid,32);
2249+
f[0] =newField(connection,"TABLE_CAT",iVarcharOid,NAME_SIZE);
2250+
f[1] =newField(connection,"TABLE_SCHEM",iVarcharOid,NAME_SIZE);
2251+
f[2] =newField(connection,"TABLE_NAME",iVarcharOid,NAME_SIZE);
2252+
f[3] =newField(connection,"COLUMN_NAME",iVarcharOid,NAME_SIZE);
2253+
f[4] =newField(connection,"GRANTOR",iVarcharOid,NAME_SIZE);
2254+
f[5] =newField(connection,"GRANTEE",iVarcharOid,NAME_SIZE);
2255+
f[6] =newField(connection,"PRIVILEGE",iVarcharOid,NAME_SIZE);
2256+
f[7] =newField(connection,"IS_GRANTABLE",iVarcharOid,NAME_SIZE);
22562257

22572258
// This is taken direct from the psql source
22582259
java.sql.ResultSetr =connection.ExecSQL("SELECT relname, relacl FROM pg_class, pg_user WHERE ( relkind = 'r' OR relkind = 'i') and relname !~ '^pg_' and relname !~ '^xin[vx][0-9]+' and usesysid = relowner and relname like '" +table.toLowerCase() +"' ORDER BY relname");
@@ -2309,14 +2310,14 @@ public java.sql.ResultSet getTablePrivileges(String catalog, String schemaPatter
23092310
if (tableNamePattern ==null)
23102311
tableNamePattern ="%";
23112312

2312-
f[0] =newField(connection,"TABLE_CAT",iVarcharOid,32);
2313-
f[1] =newField(connection,"TABLE_SCHEM",iVarcharOid,32);
2314-
f[2] =newField(connection,"TABLE_NAME",iVarcharOid,32);
2315-
f[3] =newField(connection,"COLUMN_NAME",iVarcharOid,32);
2316-
f[4] =newField(connection,"GRANTOR",iVarcharOid,32);
2317-
f[5] =newField(connection,"GRANTEE",iVarcharOid,32);
2318-
f[6] =newField(connection,"PRIVILEGE",iVarcharOid,32);
2319-
f[7] =newField(connection,"IS_GRANTABLE",iVarcharOid,32);
2313+
f[0] =newField(connection,"TABLE_CAT",iVarcharOid,NAME_SIZE);
2314+
f[1] =newField(connection,"TABLE_SCHEM",iVarcharOid,NAME_SIZE);
2315+
f[2] =newField(connection,"TABLE_NAME",iVarcharOid,NAME_SIZE);
2316+
f[3] =newField(connection,"COLUMN_NAME",iVarcharOid,NAME_SIZE);
2317+
f[4] =newField(connection,"GRANTOR",iVarcharOid,NAME_SIZE);
2318+
f[5] =newField(connection,"GRANTEE",iVarcharOid,NAME_SIZE);
2319+
f[6] =newField(connection,"PRIVILEGE",iVarcharOid,NAME_SIZE);
2320+
f[7] =newField(connection,"IS_GRANTABLE",iVarcharOid,NAME_SIZE);
23202321

23212322
// This is taken direct from the psql source
23222323
java.sql.ResultSetr =connection.ExecSQL("SELECT relname, relacl FROM pg_class, pg_user WHERE ( relkind = 'r' OR relkind = 'i') and relname !~ '^pg_' and relname !~ '^xin[vx][0-9]+' and usesysid = relowner and relname like '" +tableNamePattern.toLowerCase() +"' ORDER BY relname");
@@ -2377,9 +2378,9 @@ public java.sql.ResultSet getBestRowIdentifier(String catalog, String schema, St
23772378
Vectorv =newVector();// The new ResultSet tuple stuff
23782379

23792380
f[0] =newField(connection,"SCOPE",iInt2Oid,2);
2380-
f[1] =newField(connection,"COLUMN_NAME",iVarcharOid,32);
2381+
f[1] =newField(connection,"COLUMN_NAME",iVarcharOid,NAME_SIZE);
23812382
f[2] =newField(connection,"DATA_TYPE",iInt2Oid,2);
2382-
f[3] =newField(connection,"TYPE_NAME",iVarcharOid,32);
2383+
f[3] =newField(connection,"TYPE_NAME",iVarcharOid,NAME_SIZE);
23832384
f[4] =newField(connection,"COLUMN_SIZE",iInt4Oid,4);
23842385
f[5] =newField(connection,"BUFFER_LENGTH",iInt4Oid,4);
23852386
f[6] =newField(connection,"DECIMAL_DIGITS",iInt2Oid,2);
@@ -2533,19 +2534,19 @@ protected java.sql.ResultSet getImportedExportedKeys(String catalog, String sche
25332534
{
25342535
Fieldf[] =newField[14];
25352536

2536-
f[0] =newField(connection,"PKTABLE_CAT",iVarcharOid,32);
2537-
f[1] =newField(connection,"PKTABLE_SCHEM",iVarcharOid,32);
2538-
f[2] =newField(connection,"PKTABLE_NAME",iVarcharOid,32);
2539-
f[3] =newField(connection,"PKCOLUMN_NAME",iVarcharOid,32);
2540-
f[4] =newField(connection,"FKTABLE_CAT",iVarcharOid,32);
2541-
f[5] =newField(connection,"FKTABLE_SCHEM",iVarcharOid,32);
2542-
f[6] =newField(connection,"FKTABLE_NAME",iVarcharOid,32);
2543-
f[7] =newField(connection,"FKCOLUMN_NAME",iVarcharOid,32);
2537+
f[0] =newField(connection,"PKTABLE_CAT",iVarcharOid,NAME_SIZE);
2538+
f[1] =newField(connection,"PKTABLE_SCHEM",iVarcharOid,NAME_SIZE);
2539+
f[2] =newField(connection,"PKTABLE_NAME",iVarcharOid,NAME_SIZE);
2540+
f[3] =newField(connection,"PKCOLUMN_NAME",iVarcharOid,NAME_SIZE);
2541+
f[4] =newField(connection,"FKTABLE_CAT",iVarcharOid,NAME_SIZE);
2542+
f[5] =newField(connection,"FKTABLE_SCHEM",iVarcharOid,NAME_SIZE);
2543+
f[6] =newField(connection,"FKTABLE_NAME",iVarcharOid,NAME_SIZE);
2544+
f[7] =newField(connection,"FKCOLUMN_NAME",iVarcharOid,NAME_SIZE);
25442545
f[8] =newField(connection,"KEY_SEQ",iInt2Oid,2);
25452546
f[9] =newField(connection,"UPDATE_RULE",iInt2Oid,2);
25462547
f[10] =newField(connection,"DELETE_RULE",iInt2Oid,2);
2547-
f[11] =newField(connection,"FK_NAME",iVarcharOid,32);
2548-
f[12] =newField(connection,"PK_NAME",iVarcharOid,32);
2548+
f[11] =newField(connection,"FK_NAME",iVarcharOid,NAME_SIZE);
2549+
f[12] =newField(connection,"PK_NAME",iVarcharOid,NAME_SIZE);
25492550
f[13] =newField(connection,"DEFERRABILITY",iInt2Oid,2);
25502551

25512552
java.sql.ResultSetrs =connection.ExecSQL(
@@ -2962,19 +2963,19 @@ public java.sql.ResultSet getTypeInfo() throws SQLException
29622963
ResultSetr;// ResultSet for the SQL query that we need to do
29632964
Vectorv =newVector();// The new ResultSet tuple stuff
29642965

2965-
f[0] =newField(connection,"TYPE_NAME",iVarcharOid,32);
2966+
f[0] =newField(connection,"TYPE_NAME",iVarcharOid,NAME_SIZE);
29662967
f[1] =newField(connection,"DATA_TYPE",iInt2Oid,2);
29672968
f[2] =newField(connection,"PRECISION",iInt4Oid,4);
2968-
f[3] =newField(connection,"LITERAL_PREFIX",iVarcharOid,32);
2969-
f[4] =newField(connection,"LITERAL_SUFFIX",iVarcharOid,32);
2970-
f[5] =newField(connection,"CREATE_PARAMS",iVarcharOid,32);
2969+
f[3] =newField(connection,"LITERAL_PREFIX",iVarcharOid,NAME_SIZE);
2970+
f[4] =newField(connection,"LITERAL_SUFFIX",iVarcharOid,NAME_SIZE);
2971+
f[5] =newField(connection,"CREATE_PARAMS",iVarcharOid,NAME_SIZE);
29712972
f[6] =newField(connection,"NULLABLE",iInt2Oid,2);
29722973
f[7] =newField(connection,"CASE_SENSITIVE",iBoolOid,1);
29732974
f[8] =newField(connection,"SEARCHABLE",iInt2Oid,2);
29742975
f[9] =newField(connection,"UNSIGNED_ATTRIBUTE",iBoolOid,1);
29752976
f[10] =newField(connection,"FIXED_PREC_SCALE",iBoolOid,1);
29762977
f[11] =newField(connection,"AUTO_INCREMENT",iBoolOid,1);
2977-
f[12] =newField(connection,"LOCAL_TYPE_NAME",iVarcharOid,32);
2978+
f[12] =newField(connection,"LOCAL_TYPE_NAME",iVarcharOid,NAME_SIZE);
29782979
f[13] =newField(connection,"MINIMUM_SCALE",iInt2Oid,2);
29792980
f[14] =newField(connection,"MAXIMUM_SCALE",iInt2Oid,2);
29802981
f[15] =newField(connection,"SQL_DATA_TYPE",iInt4Oid,4);
@@ -3072,19 +3073,19 @@ public java.sql.ResultSet getIndexInfo(String catalog, String schema, String tab
30723073
java.sql.ResultSetr;// ResultSet for the SQL query that we need to do
30733074
Vectorv =newVector();// The new ResultSet tuple stuff
30743075

3075-
f[0] =newField(connection,"TABLE_CAT",iVarcharOid,32);
3076-
f[1] =newField(connection,"TABLE_SCHEM",iVarcharOid,32);
3077-
f[2] =newField(connection,"TABLE_NAME",iVarcharOid,32);
3076+
f[0] =newField(connection,"TABLE_CAT",iVarcharOid,NAME_SIZE);
3077+
f[1] =newField(connection,"TABLE_SCHEM",iVarcharOid,NAME_SIZE);
3078+
f[2] =newField(connection,"TABLE_NAME",iVarcharOid,NAME_SIZE);
30783079
f[3] =newField(connection,"NON_UNIQUE",iBoolOid,1);
3079-
f[4] =newField(connection,"INDEX_QUALIFIER",iVarcharOid,32);
3080-
f[5] =newField(connection,"INDEX_NAME",iVarcharOid,32);
3080+
f[4] =newField(connection,"INDEX_QUALIFIER",iVarcharOid,NAME_SIZE);
3081+
f[5] =newField(connection,"INDEX_NAME",iVarcharOid,NAME_SIZE);
30813082
f[6] =newField(connection,"TYPE",iInt2Oid,2);
30823083
f[7] =newField(connection,"ORDINAL_POSITION",iInt2Oid,2);
3083-
f[8] =newField(connection,"COLUMN_NAME",iVarcharOid,32);
3084-
f[9] =newField(connection,"ASC_OR_DESC",iVarcharOid,32);
3084+
f[8] =newField(connection,"COLUMN_NAME",iVarcharOid,NAME_SIZE);
3085+
f[9] =newField(connection,"ASC_OR_DESC",iVarcharOid,NAME_SIZE);
30853086
f[10] =newField(connection,"CARDINALITY",iInt4Oid,4);
30863087
f[11] =newField(connection,"PAGES",iInt4Oid,4);
3087-
f[12] =newField(connection,"FILTER_CONDITION",iVarcharOid,32);
3088+
f[12] =newField(connection,"FILTER_CONDITION",iVarcharOid,NAME_SIZE);
30883089

30893090
r =connection.ExecSQL("select " +
30903091
"c.relname, " +

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp