SCM

[#1010776] for a prepared command, ExecuteNonQuery() does not return

View Trackers | Bugs | Download .csv | Monitor

Date:
2010-03-15 11:59
Priority:
3
State:
Open
Submitted by:
Ondřej Dědek (odedek)
Assigned to:
Nobody (None)
Npgsql Version:
2.0.8
Category:
Group:
Resolution:
None
Summary:
for a prepared command, ExecuteNonQuery() does not return

Detailed description
ExecuteNonQuery() does not return nor does it throw an exception
on some database errors and only when Prepare() was used
ERROR: 22P02: invalid input syntax for integer: "XXX"
ERROR: 42P01: relation "t" does not exist at character 13
ERROR: 25P02: current transaction is aborted, commands ignored until end of
transaction block
ERROR: 22021: invalid byte sequence for encoding "UTF8": 0x00

System.Data.IDbConnection con = new Npgsql.NpgsqlConnection("Server=localhost;Pooling=False;");
con.Open();
System.Data.IDbTransaction tra = con.BeginTransaction();
System.Data.IDbCommand cmd0 = con.CreateCommand();
cmd0.Transaction = tra;
cmd0.CommandText = "CREATE TEMPORARY TABLE t (v INT NOT NULL)";
cmd0.ExecuteNonQuery();
System.Data.IDbCommand cmd = con.CreateCommand();
cmd.Transaction = tra;
cmd.CommandText = "INSERT INTO t (v) VALUES (:VALUE)";
System.Data.IDbDataParameter param = cmd.CreateParameter();
param.ParameterName = "VALUE";
cmd.Parameters.Add(param);
cmd.Prepare();
#if error_22P02 // ExecuteNonQuery() hangs
param.Value = "XXX";
#elif error_42P01 // ExecuteNonQuery() hangs
cmd0.CommandText = "DROP TABLE t";
cmd0.ExecuteNonQuery();
#elif error_25P02 // ExecuteNonQuery() hangs
try
{
cmd0.CommandText = "XXXXXXXX";
cmd0.ExecuteNonQuery();
}
catch (System.Data.Common.DbException e) { }
#elif error_22021 // ExecuteNonQuery() hangs
param.Value = "\0";
#else // ExecuteNonQuery() throws NpgsqlException as expected
param.Value = System.DBNull.Value;
#endif
cmd.ExecuteNonQuery();
con.Close();

Followup

Message
Date: 2010-06-13 20:09
Sender: Francisco Figueiredo jr.

Fix committed.

Attached Files:

Changes:

No Changes Have Been Made to This Item

Powered By FusionForge