Author: ahristov
Date: 2007-03-16 10:45:15 +0100 (Fri, 16 Mar 2007)
New Revision: 169
Modified:
trunk/ext/mysqli/mysqlnd/mysqlnd.h
trunk/ext/mysqli/mysqlnd/mysqlnd_ps.c
Log:
Handle better prefetch rows attribute
Modified: trunk/ext/mysqli/mysqlnd/mysqlnd.h
===================================================================
--- trunk/ext/mysqli/mysqlnd/mysqlnd.h 2007-03-16 09:23:34 UTC (rev 168)
+++ trunk/ext/mysqli/mysqlnd/mysqlnd.h 2007-03-16 09:45:15 UTC (rev 169)
@@ -746,7 +746,7 @@
-#define DEFAULT_PREFETCH_ROWS (ulong) 1
+#define MYSQLND_DEFAULT_PREFETCH_ROWS (ulong) 1
struct st_mysqlnd_param_bind {
zval *zv;
Modified: trunk/ext/mysqli/mysqlnd/mysqlnd_ps.c
===================================================================
--- trunk/ext/mysqli/mysqlnd/mysqlnd_ps.c 2007-03-16 09:23:34 UTC (rev 168)
+++ trunk/ext/mysqli/mysqlnd/mysqlnd_ps.c 2007-03-16 09:45:15 UTC (rev 169)
@@ -1230,7 +1230,10 @@
}
case STMT_ATTR_PREFETCH_ROWS: {
if (val == 0) {
- val = DEFAULT_PREFETCH_ROWS;
+ val = MYSQLND_DEFAULT_PREFETCH_ROWS;
+ } else if (val > 1) {
+ SET_STMT_ERROR(stmt, CR_NOT_IMPLEMENTED, UNKNOWN_SQLSTATE, "Not implemented");
+ return FAIL;
}
stmt->prefetch_rows = val;
break;
@@ -1500,6 +1503,8 @@
stmt->state = MYSQLND_STMT_INITTED;
stmt->cmd_buffer.length = 4096;
stmt->cmd_buffer.buffer = emalloc(stmt->cmd_buffer.length);
+
+ stmt->prefetch_rows = MYSQLND_DEFAULT_PREFETCH_ROWS;
/*
Mark that we reference the connection, thus it won't be
be destructed till there is open statements. The last statement
| Thread |
|---|
| • PHP mysqlnd svn commit: r169 - trunk/ext/mysqli/mysqlnd | ahristov | 16 Mar |