diff options
| author | George Schlossnagle <gschlossnagle@php.net> | 2004-05-19 19:31:33 +0000 |
|---|---|---|
| committer | George Schlossnagle <gschlossnagle@php.net> | 2004-05-19 19:31:33 +0000 |
| commit | 38a409c02fa856f53b5ccc2408e6753ba0e3e779 (patch) | |
| tree | 7acc0628ec1f9e00beca0a817bc9e916fabd09fa /ext/pdo_mysql/mysql_driver.c | |
| parent | 129997216b6fe0498503a1ce04995da459cd2b29 (diff) | |
| download | php-git-38a409c02fa856f53b5ccc2408e6753ba0e3e779.tar.gz | |
exec() now returns affected row count
Diffstat (limited to 'ext/pdo_mysql/mysql_driver.c')
| -rwxr-xr-x | ext/pdo_mysql/mysql_driver.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/ext/pdo_mysql/mysql_driver.c b/ext/pdo_mysql/mysql_driver.c index 2aed63dd3f..3f64a8326f 100755 --- a/ext/pdo_mysql/mysql_driver.c +++ b/ext/pdo_mysql/mysql_driver.c @@ -75,26 +75,18 @@ static int mysql_handle_preparer(pdo_dbh_t *dbh, const char *sql, long sql_len, return 1; } -static int mysql_handle_doer(pdo_dbh_t *dbh, const char *sql, long sql_len TSRMLS_DC) +static long mysql_handle_doer(pdo_dbh_t *dbh, const char *sql, long sql_len TSRMLS_DC) { pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data; if (mysql_real_query(H->server, sql, sql_len)) { pdo_mysql_error(H); - return 0; + return -1; } else { - return 1; + return mysql_affected_rows(H->server); } } -static long pdo_mysql_affected_rows(pdo_dbh_t *dbh TSRMLS_DC) -{ - pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data; - my_ulonglong afr = mysql_affected_rows(H->server); - - return afr == (my_ulonglong) - 1 ? 0 : (long) afr; -} - static long pdo_mysql_last_insert_id(pdo_dbh_t *dbh TSRMLS_DC) { pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data; @@ -124,7 +116,6 @@ static struct pdo_dbh_methods mysql_methods = { NULL, NULL, NULL, - pdo_mysql_affected_rows, pdo_mysql_last_insert_id }; |
