]> granicus.if.org Git - php/commitdiff
changed prototype mysql_dataseek from void to bool
authorGeorg Richter <georg@php.net>
Tue, 27 Jan 2004 13:56:03 +0000 (13:56 +0000)
committerGeorg Richter <georg@php.net>
Tue, 27 Jan 2004 13:56:03 +0000 (13:56 +0000)
  add check for specified offset

ext/mysqli/mysqli_api.c

index f0b30b2c4b944dc1f1a509500b459f9ea7884f05..8282361bf239431fe9dbc7b919f75e8766e11bae 100644 (file)
@@ -420,7 +420,7 @@ PHP_FUNCTION(mysqli_commit)
 }
 /* }}} */
 
-/* {{{ proto void mysqli_data_seek(object result, int offset)
+/* {{{ proto bool mysqli_data_seek(object result, int offset)
    Move internal result pointer */
 PHP_FUNCTION(mysqli_data_seek)
 {
@@ -436,11 +436,15 @@ PHP_FUNCTION(mysqli_data_seek)
 
        if (result->handle && result->handle->status == MYSQL_STATUS_USE_RESULT) {
                php_error_docref(NULL TSRMLS_CC, E_WARNING, "Function cannot be used with MYSQL_USE_RESULT");
-               RETURN_LONG(0);
+               RETURN_FALSE;
+       }
+
+       if (!offset || offset >= result->row_count) {
+          RETURN_FALSE;
        }
 
        mysql_data_seek(result, offset);
-       return;
+       RETURN_TRUE;
 }
 /* }}} */