Update of /cvsroot/pgsqlclient/pgsqlclient/PostgreSql.Data.PGSqlClient/source
In directory sc8-pr-cvs1:/tmp/cvs-serv12482
Modified Files:
PGDataReader.cs
Log Message:
Fixed implementation of GetSchemaTable method.
Index: PGDataReader.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient/PostgreSql.Data.PGSqlClient/source/PGDataReader.cs,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** PGDataReader.cs 12 Jul 2003 08:11:21 -0000 1.1.1.1
--- PGDataReader.cs 13 Jul 2003 11:41:12 -0000 1.2
***************
*** 250,270 ****
schemaRow["IsRowVersion"] = false;
schemaRow["IsUnique"] = false;
- schemaRow["IsKey"] = isPrimaryKey(pKeyInfo, (short)columnInfo[7]);
schemaRow["IsAutoIncrement"] = isAutoIncrement(i);
schemaRow["IsAliased"] = isAliased(i);
schemaRow["IsExpression"] = isExpression(i);
if (columnInfo != null)
{
! schemaRow["AllowDBNull"] = columnInfo[10];
! schemaRow["BaseSchemaName"] = columnInfo[1];
! schemaRow["BaseCatalogName"] = columnInfo[0];
! schemaRow["BaseTableName"] = columnInfo[2];
! schemaRow["BaseColumnName"] = columnInfo[3];
}
else
{
! schemaRow["AllowDBNull"] = System.DBNull.Value;
schemaRow["BaseSchemaName"] = System.DBNull.Value;
- schemaRow["BaseCatalogName"] = System.DBNull.Value;
schemaRow["BaseTableName"] = System.DBNull.Value;
schemaRow["BaseColumnName"] = System.DBNull.Value;
--- 250,270 ----
schemaRow["IsRowVersion"] = false;
schemaRow["IsUnique"] = false;
schemaRow["IsAutoIncrement"] = isAutoIncrement(i);
schemaRow["IsAliased"] = isAliased(i);
schemaRow["IsExpression"] = isExpression(i);
+ schemaRow["BaseCatalogName"] = System.DBNull.Value;
if (columnInfo != null)
{
! schemaRow["IsKey"] = isPrimaryKey(pKeyInfo, (short)columnInfo[6]);
! schemaRow["AllowDBNull"] = columnInfo[9];
! schemaRow["BaseSchemaName"] = columnInfo[0].ToString();
! schemaRow["BaseTableName"] = columnInfo[1].ToString();
! schemaRow["BaseColumnName"] = columnInfo[2].ToString();
}
else
{
! schemaRow["IsKey"] = false;
! schemaRow["AllowDBNull"] = System.DBNull.Value;
schemaRow["BaseSchemaName"] = System.DBNull.Value;
schemaRow["BaseTableName"] = System.DBNull.Value;
schemaRow["BaseColumnName"] = System.DBNull.Value;
***************
*** 293,297 ****
schemaCmd.InternalExecute();
! if (schemaCmd.Statement.Rows[0] != null)
{
columnInfo = (object[])schemaCmd.Statement.Rows[0];
--- 293,297 ----
schemaCmd.InternalExecute();
! if (schemaCmd.Statement.Rows.Count > 0)
{
columnInfo = (object[])schemaCmd.Statement.Rows[0];
***************
*** 316,323 ****
schemaCmd.InternalExecute();
! if (schemaCmd.Statement.Rows[0] != null)
{
object[] temp = (object[])schemaCmd.Statement.Rows[0];
! columnInfo = (System.Array)temp[4];
}
--- 316,323 ----
schemaCmd.InternalExecute();
! if (schemaCmd.Statement.Rows.Count > 0)
{
object[] temp = (object[])schemaCmd.Statement.Rows[0];
! columnInfo = (System.Array)temp[3];
}
***************
*** 330,334 ****
private bool isPrimaryKey(System.Array pKeyInfo, short ordinal)
{
! for (int i = 0; i < pKeyInfo.Length; i++)
{
if ((short)pKeyInfo.GetValue(i) == ordinal)
--- 330,334 ----
private bool isPrimaryKey(System.Array pKeyInfo, short ordinal)
{
! for (int i = 1; i < pKeyInfo.Length; i++)
{
if ((short)pKeyInfo.GetValue(i) == ordinal)
|