Changeset: e93132843f69 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e93132843f69
Modified Files:
clients/odbc/driver/SQLPrepare.c
java/src/nl/cwi/monetdb/jdbc/MonetPreparedStatement.java
sql/backends/monet5/sql_result.mx
Branch: Dec2011
Log Message:
Distinguish params from results in preparesult result set using NULL.
diffs (55 lines):
diff --git a/clients/odbc/driver/SQLPrepare.c b/clients/odbc/driver/SQLPrepare.c
--- a/clients/odbc/driver/SQLPrepare.c
+++ b/clients/odbc/driver/SQLPrepare.c
@@ -137,8 +137,7 @@ SQLPrepare_(ODBCStmt *stmt,
mapi_fetch_row(hdl);
if (ncols == 3 ||
- (s = mapi_fetch_field(hdl, 5)) == NULL ||
- *s == 0) {
+ (s = mapi_fetch_field(hdl, 5)) == NULL) {
/* either old prepare (i.e. old server) or no
* column name: either way, this describes a
* parameter */
diff --git a/java/src/nl/cwi/monetdb/jdbc/MonetPreparedStatement.java
b/java/src/nl/cwi/monetdb/jdbc/MonetPreparedStatement.java
--- a/java/src/nl/cwi/monetdb/jdbc/MonetPreparedStatement.java
+++ b/java/src/nl/cwi/monetdb/jdbc/MonetPreparedStatement.java
@@ -302,7 +302,7 @@ public class MonetPreparedStatement
private int getColumnIdx(int colnr) throws SQLException {
int curcol = 0;
for (int i = 0; i < size; i++) {
- if (!column[i].equals(""))
+ if (column[i] != null)
continue;
curcol++;
if (curcol == colnr)
@@ -350,7 +350,7 @@ public class MonetPreparedStatement
int cnt = 0;
for (int i = 0; i < size; i++) {
- if (!column[i].equals(""))
+ if (column[i] != null)
cnt++;
}
@@ -2192,7 +2192,7 @@ public class MonetPreparedStatement
// check if all columns are set and do a replace
int col = 0;
for (int i = 0; i < size; i++) {
- if (!column[i].equals(""))
+ if (column[i] != null)
continue;
col++;
if (col > 1)
diff --git a/sql/backends/monet5/sql_result.mx
b/sql/backends/monet5/sql_result.mx
--- a/sql/backends/monet5/sql_result.mx
+++ b/sql/backends/monet5/sql_result.mx
@@ -800,7 +800,7 @@ mvc_export_prepare(mvc *c, stream *out,
q->paramlen = len;
q->params = SA_NEW_ARRAY(q->sa, sql_subtype, len);
if (result)
- extra = ",\t\"\",\t\"\",\t\"\"";
+ extra = ",\tNULL,\tNULL,\tNULL";
for (n = c->params->h, i=0; n; n = n->next, i++) {
a = n->data;
t = &a->type;
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list