summaryrefslogtreecommitdiff
path: root/ext/pdo_mysql
diff options
context:
space:
mode:
authorSean Finney <seanius@debian.org>2009-06-24 22:49:04 +0200
committerSean Finney <seanius@debian.org>2009-06-24 22:49:04 +0200
commit84f4ca9b07fe5b73d840258f4aa7c1eb534c4253 (patch)
tree9829bd578af8a4a8b42b04277f9067e00dc5ad90 /ext/pdo_mysql
parent6821b67124604da690c5e9276d5370d679c63ac8 (diff)
downloadphp-84f4ca9b07fe5b73d840258f4aa7c1eb534c4253.tar.gz
Imported Upstream version 5.3.0~RC4upstream/5.3.0_RC4upstream/5.3.0.RC4
Diffstat (limited to 'ext/pdo_mysql')
-rwxr-xr-xext/pdo_mysql/mysql_statement.c33
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_stmt_fetch_serialize.phpt1
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_stmt_fetch_serialize_simple.phpt3
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_stmt_multiquery.phpt2
4 files changed, 18 insertions, 21 deletions
diff --git a/ext/pdo_mysql/mysql_statement.c b/ext/pdo_mysql/mysql_statement.c
index c54e9584c..9ef009c5d 100755
--- a/ext/pdo_mysql/mysql_statement.c
+++ b/ext/pdo_mysql/mysql_statement.c
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: mysql_statement.c,v 1.48.2.14.2.6.2.4 2009/01/14 19:16:24 iliaa Exp $ */
+/* $Id: mysql_statement.c,v 1.48.2.14.2.6.2.5 2009/05/20 08:30:12 kalle Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -122,10 +122,10 @@ static int pdo_mysql_stmt_dtor(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
static void pdo_mysql_stmt_set_row_count(pdo_stmt_t *stmt) /* {{{ */
{
- my_ulonglong row_count;
+ long row_count;
pdo_mysql_stmt *S = stmt->driver_data;
- row_count = mysql_stmt_affected_rows(S->stmt);
- if (row_count != (my_ulonglong)-1) {
+ row_count = (long) mysql_stmt_affected_rows(S->stmt);
+ if (row_count != (long)-1) {
stmt->row_count = row_count;
}
}
@@ -248,7 +248,7 @@ static int pdo_mysql_stmt_execute_prepared_mysqlnd(pdo_stmt_t *stmt TSRMLS_DC) /
{
pdo_mysql_stmt *S = stmt->driver_data;
pdo_mysql_db_handle *H = S->H;
- unsigned int i;
+ int i;
PDO_DBG_ENTER("pdo_mysql_stmt_execute_prepared_mysqlnd");
@@ -325,13 +325,13 @@ static int pdo_mysql_stmt_execute(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
PDO_DBG_RETURN(0);
}
- stmt->row_count = mysql_num_rows(S->result);
+ stmt->row_count = (long) mysql_num_rows(S->result);
stmt->column_count = (int) mysql_num_fields(S->result);
S->fields = mysql_fetch_fields(S->result);
} else {
/* this was a DML or DDL query (INSERT, UPDATE, DELETE, ... */
- stmt->row_count = row_count;
+ stmt->row_count = (long) row_count;
}
PDO_DBG_RETURN(1);
@@ -343,7 +343,7 @@ static int pdo_mysql_stmt_next_rowset(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
#if HAVE_MYSQL_NEXT_RESULT || PDO_USE_MYSQLND
pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data;
pdo_mysql_db_handle *H = S->H;
- my_ulonglong row_count;
+ long row_count;
int ret;
PDO_DBG_ENTER("pdo_mysql_stmt_next_rowset");
PDO_DBG_INF_FMT("stmt=%p", S->stmt);
@@ -374,7 +374,7 @@ static int pdo_mysql_stmt_next_rowset(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
}
{
/* for SHOW/DESCRIBE and others the column/field count is not available before execute */
- unsigned int i;
+ int i;
stmt->column_count = S->stmt->field_count;
for (i = 0; i < stmt->column_count; i++) {
@@ -388,12 +388,13 @@ static int pdo_mysql_stmt_next_rowset(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
/* if buffered, pre-fetch all the data */
if (H->buffered) {
- if (mysql_stmt_store_result(S->stmt))
+ if (mysql_stmt_store_result(S->stmt)) {
PDO_DBG_RETURN(1);
+ }
}
}
- row_count = mysql_stmt_affected_rows(S->stmt);
- if (row_count != (my_ulonglong)-1) {
+ row_count = (long) mysql_stmt_affected_rows(S->stmt);
+ if (row_count != (long)-1) {
stmt->row_count = row_count;
}
PDO_DBG_RETURN(1);
@@ -426,7 +427,7 @@ static int pdo_mysql_stmt_next_rowset(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
row_count = 0;
} else {
S->result = mysql_store_result(H->server);
- if ((my_ulonglong)-1 == (row_count = mysql_affected_rows(H->server))) {
+ if ((long)-1 == (row_count = (long) mysql_affected_rows(H->server))) {
pdo_mysql_error_stmt(stmt);
PDO_DBG_RETURN(0);
}
@@ -493,7 +494,7 @@ static int pdo_mysql_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_da
PDO_DBG_RETURN(1);
case PDO_PARAM_EVT_EXEC_PRE:
- if (S->params_given < S->num_params) {
+ if (S->params_given < (unsigned int) S->num_params) {
/* too few parameter bound */
PDO_DBG_ERR("too few parameters bound");
strcpy(stmt->error_code, "HY093");
@@ -671,7 +672,7 @@ static int pdo_mysql_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC) /* {{{
{
pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data;
struct pdo_column_data *cols = stmt->columns;
- unsigned int i;
+ int i;
PDO_DBG_ENTER("pdo_mysql_stmt_describe");
PDO_DBG_INF_FMT("stmt=%p", S->stmt);
@@ -690,7 +691,7 @@ static int pdo_mysql_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC) /* {{{
if (cols[0].name) {
PDO_DBG_RETURN(1);
}
- for (i=0; i < stmt->column_count; i++) {
+ for (i = 0; i < stmt->column_count; i++) {
int namelen;
if (S->H->fetch_table_names) {
diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_fetch_serialize.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_fetch_serialize.phpt
index 5886a82c8..db8f2f5ea 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_stmt_fetch_serialize.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_fetch_serialize.phpt
@@ -131,7 +131,6 @@ object(myclass)#4 (1) {
Using PDO::FETCH_CLASS|PDO::FETCH_SERIALIZE to fetch the object from DB and unserialize it...
myclass::unserialize('C:7:"myclass":19:{Data from serialize}')
-myclass::__construct(PDO shall not call __construct())
object(myclass)#%d (1) {
["myprotected":protected]=>
string(19) "a protected propery"
diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_fetch_serialize_simple.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_fetch_serialize_simple.phpt
index ba29e6a53..e9b231cfd 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_stmt_fetch_serialize_simple.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_fetch_serialize_simple.phpt
@@ -80,17 +80,14 @@ object(myclass)#%d (0) {
And now magic PDO using fetchAll(PDO::FETCH_CLASS|PDO::FETCH_SERIALIZE)...
myclass::unserialize('Data fetched from DB to be given to unserialize()')
-myclass::__construct('Called by PDO') - note that it must not be called when unserializing
object(myclass)#%d (0) {
}
myclass::unserialize('Data fetched from DB to be given to unserialize()')
-myclass::__construct(NULL) - note that it must not be called when unserializing
object(myclass)#%d (0) {
}
And now PDO using setFetchMode(PDO::FETCH:CLASS|PDO::FETCH_SERIALIZE) + fetch()...
myclass::unserialize('Data fetched from DB to be given to unserialize()')
-myclass::__construct('Called by PDO') - note that it must not be called when unserializing
object(myclass)#%d (0) {
}
done!
diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_multiquery.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_multiquery.phpt
index f88a1a385..fbff844e3 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_stmt_multiquery.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_multiquery.phpt
@@ -93,6 +93,6 @@ array(1) {
}
Native Prepared Statements...
-Warning: PDO::query(): SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '; SELECT label FROM test ORDER BY id ASC LIMIT 1' at line %d in %s on line %d
+Warning: PDO::query(): SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '%SSELECT label FROM test ORDER BY id ASC LIMIT 1' at line %d in %s on line %d
Fatal error: Call to a member function errorInfo() on a non-object in %s on line %d