mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Sorry for the commit but compiler warnings are annoying and so are white spaces at the end of a line, if one uses an editor which removes them on save and diff's get blown
up by white space changes... Changes: - remove end of line white space - fix compiler warning "ext/mysqli/mysqli_priv.h:156:27: warning: no newline at end of file" - fix compiler warning "ext/mysqli/mysqli_fe.h:135:25: warning: no newline at end of file" - fix compiler warning "ext/mysqli/mysqli.c:896:11: warning: extra tokens at end of #ifdef directive"
This commit is contained in:
parent
e8c87c6d21
commit
e20c62d3be
15 changed files with 163 additions and 163 deletions
|
@ -17,7 +17,7 @@
|
|||
| Ulf Wendel <uw@php.net> |
|
||||
+----------------------------------------------------------------------+
|
||||
|
||||
$Id$
|
||||
$Id$
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
|
@ -400,7 +400,7 @@ void mysqli_add_property(HashTable *h, const char *pname, size_t pname_len, mysq
|
|||
|
||||
p.name = (char*) pname;
|
||||
p.name_len = pname_len;
|
||||
p.read_func = (r_func) ? r_func : mysqli_read_na;
|
||||
p.read_func = (r_func) ? r_func : mysqli_read_na;
|
||||
p.write_func = (w_func) ? w_func : mysqli_write_na;
|
||||
zend_hash_add(h, pname, pname_len + 1, &p, sizeof(mysqli_prop_handler), NULL);
|
||||
}
|
||||
|
@ -439,7 +439,7 @@ static int mysqli_object_has_property(zval *object, zval *member, int has_set_ex
|
|||
break;
|
||||
}
|
||||
default:
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid value for has_set_exists");
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid value for has_set_exists");
|
||||
}
|
||||
} else {
|
||||
zend_object_handlers * std_hnd = zend_get_std_object_handlers();
|
||||
|
@ -465,7 +465,7 @@ HashTable * mysqli_object_get_debug_info(zval *object, int *is_temp TSRMLS_DC)
|
|||
zval member;
|
||||
zval *value;
|
||||
INIT_ZVAL(member);
|
||||
ZVAL_STRINGL(&member, entry->name, entry->name_len, 0);
|
||||
ZVAL_STRINGL(&member, entry->name, entry->name_len, 0);
|
||||
value = mysqli_read_property(object, &member, BP_VAR_IS, 0 TSRMLS_CC);
|
||||
if (value != EG(uninitialized_zval_ptr)) {
|
||||
Z_ADDREF_P(value);
|
||||
|
@ -498,7 +498,7 @@ PHP_MYSQLI_EXPORT(zend_object_value) mysqli_objects_new(zend_class_entry *class_
|
|||
mysqli_base_class->parent != NULL) {
|
||||
mysqli_base_class = mysqli_base_class->parent;
|
||||
}
|
||||
zend_hash_find(&classes, mysqli_base_class->name, mysqli_base_class->name_length + 1,
|
||||
zend_hash_find(&classes, mysqli_base_class->name, mysqli_base_class->name_length + 1,
|
||||
(void **) &intern->prop_handler);
|
||||
|
||||
zend_object_std_init(&intern->zo, class_type TSRMLS_CC);
|
||||
|
@ -581,7 +581,7 @@ PHP_MINIT_FUNCTION(mysqli)
|
|||
{
|
||||
zend_class_entry *ce,cex;
|
||||
zend_object_handlers *std_hnd = zend_get_std_object_handlers();
|
||||
|
||||
|
||||
REGISTER_INI_ENTRIES();
|
||||
#ifndef MYSQLI_USE_MYSQLND
|
||||
#if MYSQL_VERSION_ID >= 40000
|
||||
|
@ -615,7 +615,7 @@ PHP_MINIT_FUNCTION(mysqli)
|
|||
#endif
|
||||
mysqli_exception_class_entry->ce_flags |= ZEND_ACC_FINAL;
|
||||
zend_declare_property_long(mysqli_exception_class_entry, "code", sizeof("code")-1, 0, ZEND_ACC_PROTECTED TSRMLS_CC);
|
||||
zend_declare_property_string(mysqli_exception_class_entry, "sqlstate", sizeof("sqlstate")-1, "00000", ZEND_ACC_PROTECTED TSRMLS_CC);
|
||||
zend_declare_property_string(mysqli_exception_class_entry, "sqlstate", sizeof("sqlstate")-1, "00000", ZEND_ACC_PROTECTED TSRMLS_CC);
|
||||
|
||||
REGISTER_MYSQLI_CLASS_ENTRY("mysqli_driver", mysqli_driver_class_entry, mysqli_driver_methods);
|
||||
ce = mysqli_driver_class_entry;
|
||||
|
@ -656,7 +656,7 @@ PHP_MINIT_FUNCTION(mysqli)
|
|||
MYSQLI_ADD_PROPERTIES(&mysqli_stmt_properties, mysqli_stmt_property_entries);
|
||||
MYSQLI_ADD_PROPERTIES_INFO(ce, mysqli_stmt_property_info_entries);
|
||||
zend_hash_add(&classes, ce->name, ce->name_length+1, &mysqli_stmt_properties, sizeof(mysqli_stmt_properties), NULL);
|
||||
|
||||
|
||||
/* mysqli_options */
|
||||
REGISTER_LONG_CONSTANT("MYSQLI_READ_DEFAULT_GROUP", MYSQL_READ_DEFAULT_GROUP, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("MYSQLI_READ_DEFAULT_FILE", MYSQL_READ_DEFAULT_FILE, CONST_CS | CONST_PERSISTENT);
|
||||
|
@ -671,10 +671,10 @@ PHP_MINIT_FUNCTION(mysqli)
|
|||
REGISTER_LONG_CONSTANT("MYSQLI_OPT_INT_AND_FLOAT_NATIVE", MYSQLND_OPT_INT_AND_FLOAT_NATIVE, CONST_CS | CONST_PERSISTENT);
|
||||
#endif
|
||||
#if MYSQL_VERSION_ID > 50110 || defined(MYSQLI_USE_MYSQLND)
|
||||
REGISTER_LONG_CONSTANT("MYSQLI_OPT_SSL_VERIFY_SERVER_CERT", MYSQL_OPT_SSL_VERIFY_SERVER_CERT, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("MYSQLI_OPT_SSL_VERIFY_SERVER_CERT", MYSQL_OPT_SSL_VERIFY_SERVER_CERT, CONST_CS | CONST_PERSISTENT);
|
||||
#endif
|
||||
|
||||
/* mysqli_real_connect flags */
|
||||
/* mysqli_real_connect flags */
|
||||
REGISTER_LONG_CONSTANT("MYSQLI_CLIENT_SSL", CLIENT_SSL, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("MYSQLI_CLIENT_COMPRESS",CLIENT_COMPRESS, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("MYSQLI_CLIENT_INTERACTIVE", CLIENT_INTERACTIVE, CONST_CS | CONST_PERSISTENT);
|
||||
|
@ -693,7 +693,7 @@ PHP_MINIT_FUNCTION(mysqli)
|
|||
REGISTER_LONG_CONSTANT("MYSQLI_ASSOC", MYSQLI_ASSOC, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("MYSQLI_NUM", MYSQLI_NUM, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("MYSQLI_BOTH", MYSQLI_BOTH, CONST_CS | CONST_PERSISTENT);
|
||||
|
||||
|
||||
/* for mysqli_stmt_set_attr */
|
||||
REGISTER_LONG_CONSTANT("MYSQLI_STMT_ATTR_UPDATE_MAX_LENGTH", STMT_ATTR_UPDATE_MAX_LENGTH, CONST_CS | CONST_PERSISTENT);
|
||||
|
||||
|
@ -708,7 +708,7 @@ PHP_MINIT_FUNCTION(mysqli)
|
|||
#if MYSQL_VERSION_ID > 50007 || defined(MYSQLI_USE_MYSQLND)
|
||||
REGISTER_LONG_CONSTANT("MYSQLI_STMT_ATTR_PREFETCH_ROWS", STMT_ATTR_PREFETCH_ROWS, CONST_CS | CONST_PERSISTENT);
|
||||
#endif
|
||||
|
||||
|
||||
/* column information */
|
||||
REGISTER_LONG_CONSTANT("MYSQLI_NOT_NULL_FLAG", NOT_NULL_FLAG, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("MYSQLI_PRI_KEY_FLAG", PRI_KEY_FLAG, CONST_CS | CONST_PERSISTENT);
|
||||
|
@ -766,7 +766,7 @@ PHP_MINIT_FUNCTION(mysqli)
|
|||
#endif
|
||||
|
||||
REGISTER_LONG_CONSTANT("MYSQLI_SET_CHARSET_NAME", MYSQL_SET_CHARSET_NAME, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("MYSQLI_SET_CHARSET_DIR", MYSQL_SET_CHARSET_DIR, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("MYSQLI_SET_CHARSET_DIR", MYSQL_SET_CHARSET_DIR, CONST_CS | CONST_PERSISTENT);
|
||||
|
||||
/* bind support */
|
||||
REGISTER_LONG_CONSTANT("MYSQLI_NO_DATA", MYSQL_NO_DATA, CONST_CS | CONST_PERSISTENT);
|
||||
|
@ -971,9 +971,9 @@ ZEND_GET_MODULE(mysqli)
|
|||
#endif
|
||||
|
||||
|
||||
/* {{{ mixed mysqli_stmt_construct()
|
||||
/* {{{ mixed mysqli_stmt_construct()
|
||||
constructor for statement object.
|
||||
Parameters:
|
||||
Parameters:
|
||||
object -> mysqli_stmt_init
|
||||
object, query -> mysqli_prepare
|
||||
*/
|
||||
|
@ -1028,9 +1028,9 @@ PHP_FUNCTION(mysqli_stmt_construct)
|
|||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ mixed mysqli_result_construct()
|
||||
/* {{{ mixed mysqli_result_construct()
|
||||
constructor for result object.
|
||||
Parameters:
|
||||
Parameters:
|
||||
object [, mode] -> mysqli_store/use_result
|
||||
*/
|
||||
PHP_FUNCTION(mysqli_result_construct)
|
||||
|
@ -1130,7 +1130,7 @@ void php_mysqli_fetch_into_hash_aux(zval *return_value, MYSQL_RES * result, long
|
|||
*/
|
||||
snprintf(tmp, sizeof(tmp), (mysql_fetch_field_direct(result, i)->flags & UNSIGNED_FLAG)? MYSQLI_LLU_SPEC : MYSQLI_LL_SPEC, llval);
|
||||
ZVAL_STRING(res, tmp, 1);
|
||||
} else
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
|
||||
|
@ -1139,7 +1139,7 @@ void php_mysqli_fetch_into_hash_aux(zval *return_value, MYSQL_RES * result, long
|
|||
Z_TYPE_P(res) = IS_STRING;
|
||||
Z_STRVAL_P(res) = php_addslashes(row[i], field_len[i], &Z_STRLEN_P(res), 0 TSRMLS_CC);
|
||||
} else {
|
||||
ZVAL_STRINGL(res, row[i], field_len[i], 1);
|
||||
ZVAL_STRINGL(res, row[i], field_len[i], 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1208,7 +1208,7 @@ void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags
|
|||
}
|
||||
}
|
||||
}
|
||||
MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, &mysql_result, "mysqli_result", MYSQLI_STATUS_VALID);
|
||||
MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, &mysql_result, "mysqli_result", MYSQLI_STATUS_VALID);
|
||||
|
||||
if (fetchtype < MYSQLI_ASSOC || fetchtype > MYSQLI_BOTH) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "The result type should be either MYSQLI_NUM, MYSQLI_ASSOC or MYSQLI_BOTH");
|
||||
|
@ -1221,7 +1221,7 @@ void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags
|
|||
zval dataset = *return_value;
|
||||
zend_fcall_info fci;
|
||||
zend_fcall_info_cache fcc;
|
||||
zval *retval_ptr;
|
||||
zval *retval_ptr;
|
||||
|
||||
object_and_properties_init(return_value, ce, NULL);
|
||||
zend_merge_properties(return_value, Z_ARRVAL(dataset), 1 TSRMLS_CC);
|
||||
|
@ -1248,7 +1248,7 @@ void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags
|
|||
} else {
|
||||
/* Two problems why we throw exceptions here: PHP is typeless
|
||||
* and hence passing one argument that's not an array could be
|
||||
* by mistake and the other way round is possible, too. The
|
||||
* by mistake and the other way round is possible, too. The
|
||||
* single value is an array. Also we'd have to make that one
|
||||
* argument passed by reference.
|
||||
*/
|
||||
|
@ -1342,7 +1342,7 @@ static int php_local_infile_init(void **ptr, const char *filename, void *userdat
|
|||
mysql->li_stream = php_stream_open_wrapper_ex((char *)filename, "r", 0, NULL, context);
|
||||
|
||||
if (mysql->li_stream == NULL) {
|
||||
snprintf((char *)data->error_msg, sizeof(data->error_msg), "Can't find file '%-.64s'.", filename);
|
||||
snprintf((char *)data->error_msg, sizeof(data->error_msg), "Can't find file '%-.64s'.", filename);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -1391,7 +1391,7 @@ static int php_local_infile_read(void *ptr, char *buf, uint buf_len)
|
|||
ZVAL_LONG(*callback_args[2], buf_len);
|
||||
ZVAL_STRING(*callback_args[3], "", 1);
|
||||
|
||||
if (call_user_function_ex(EG(function_table),
|
||||
if (call_user_function_ex(EG(function_table),
|
||||
NULL,
|
||||
mysql->li_read,
|
||||
&retval,
|
||||
|
@ -1482,7 +1482,7 @@ static void php_local_infile_end(void *ptr)
|
|||
/* }}} */
|
||||
|
||||
|
||||
/* {{{ void php_set_local_infile_handler_default
|
||||
/* {{{ void php_set_local_infile_handler_default
|
||||
*/
|
||||
void php_set_local_infile_handler_default(MY_MYSQL *mysql) {
|
||||
/* register internal callback functions */
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
| Ulf Wendel <uw@php.net> |
|
||||
+----------------------------------------------------------------------+
|
||||
|
||||
$Id$
|
||||
$Id$
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
|
@ -230,7 +230,7 @@ PHP_FUNCTION(mysqli_stmt_bind_param)
|
|||
|
||||
if (zend_parse_method_parameters((getThis()) ? 1:2 TSRMLS_CC, getThis(), "Os", &mysql_stmt, mysqli_stmt_class_entry,
|
||||
&types, &types_len) == FAILURE) {
|
||||
return;
|
||||
return;
|
||||
}
|
||||
|
||||
MYSQLI_FETCH_RESOURCE_STMT(stmt, &mysql_stmt, MYSQLI_STATUS_VALID);
|
||||
|
@ -261,7 +261,7 @@ PHP_FUNCTION(mysqli_stmt_bind_param)
|
|||
args = (zval ***)safe_emalloc(argc, sizeof(zval **), 0);
|
||||
|
||||
if (zend_get_parameters_array_ex(argc, args) == FAILURE) {
|
||||
zend_wrong_param_count(TSRMLS_C);
|
||||
zend_wrong_param_count(TSRMLS_C);
|
||||
rc = 1;
|
||||
} else {
|
||||
rc = mysqli_stmt_bind_param_do_bind(stmt, argc, num_vars, args, start, types TSRMLS_CC);
|
||||
|
@ -352,8 +352,8 @@ mysqli_stmt_bind_result_do_bind(MY_STMT *stmt, zval ***args, unsigned int argc,
|
|||
#if MYSQL_VERSION_ID > 50002 || defined(MYSQLI_USE_MYSQLND)
|
||||
case MYSQL_TYPE_BIT:
|
||||
#endif
|
||||
stmt->result.buf[ofs].type = IS_STRING;
|
||||
stmt->result.buf[ofs].buflen = sizeof(my_ulonglong);
|
||||
stmt->result.buf[ofs].type = IS_STRING;
|
||||
stmt->result.buf[ofs].buflen = sizeof(my_ulonglong);
|
||||
stmt->result.buf[ofs].val = (char *)emalloc(stmt->result.buf[ofs].buflen);
|
||||
bind[ofs].buffer_type = col_type;
|
||||
bind[ofs].buffer = stmt->result.buf[ofs].val;
|
||||
|
@ -390,7 +390,7 @@ mysqli_stmt_bind_result_do_bind(MY_STMT *stmt, zval ***args, unsigned int argc,
|
|||
/*
|
||||
If the user has called $stmt->store_result() then we have asked
|
||||
max_length to be updated. this is done only for BLOBS because we don't want to allocate
|
||||
big chunkgs of memory 2^16 or 2^24
|
||||
big chunkgs of memory 2^16 or 2^24
|
||||
*/
|
||||
if (stmt->stmt->fields[ofs].max_length == 0 &&
|
||||
!mysql_stmt_attr_get(stmt->stmt, STMT_ATTR_UPDATE_MAX_LENGTH, &tmp) && !tmp)
|
||||
|
@ -484,7 +484,7 @@ PHP_FUNCTION(mysqli_stmt_bind_result)
|
|||
}
|
||||
|
||||
if (zend_parse_method_parameters((getThis()) ? 0:1 TSRMLS_CC, getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
|
||||
return;
|
||||
return;
|
||||
}
|
||||
|
||||
MYSQLI_FETCH_RESOURCE_STMT(stmt, &mysql_stmt, MYSQLI_STATUS_VALID);
|
||||
|
@ -545,7 +545,7 @@ PHP_FUNCTION(mysqli_change_user)
|
|||
if (mysql_get_server_version(mysql->mysql) < 501023L) {
|
||||
/*
|
||||
Request the current charset, or it will be reset to the system one.
|
||||
5.0 doesn't support it. Support added in 5.1.23 by fixing the following bug :
|
||||
5.0 doesn't support it. Support added in 5.1.23 by fixing the following bug :
|
||||
Bug #30472 libmysql doesn't reset charset, insert_id after succ. mysql_change_user() call
|
||||
*/
|
||||
rc = mysql_set_character_set(mysql->mysql, old_charset->csname);
|
||||
|
@ -612,7 +612,7 @@ PHP_FUNCTION(mysqli_close)
|
|||
{
|
||||
zval *mysql_link;
|
||||
MY_MYSQL *mysql;
|
||||
|
||||
|
||||
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
@ -684,7 +684,7 @@ PHP_FUNCTION(mysqli_debug)
|
|||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &debug, &debug_len) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
mysql_debug(debug);
|
||||
RETURN_TRUE;
|
||||
}
|
||||
|
@ -724,7 +724,7 @@ PHP_FUNCTION(mysqli_errno)
|
|||
|
||||
/* {{{ proto string mysqli_error(object link)
|
||||
Returns the text of the error message from previous MySQL operation */
|
||||
PHP_FUNCTION(mysqli_error)
|
||||
PHP_FUNCTION(mysqli_error)
|
||||
{
|
||||
MY_MYSQL *mysql;
|
||||
zval *mysql_link;
|
||||
|
@ -743,7 +743,7 @@ static void
|
|||
php_mysqli_stmt_copy_it(zval *** copies, zval *original, uint param_count, uint current)
|
||||
{
|
||||
if (!*copies) {
|
||||
*copies = ecalloc(param_count, sizeof(zval *));
|
||||
*copies = ecalloc(param_count, sizeof(zval *));
|
||||
}
|
||||
MAKE_STD_ZVAL((*copies)[current]);
|
||||
*(*copies)[current] = *original;
|
||||
|
@ -856,13 +856,13 @@ void mysqli_stmt_fetch_libmysql(INTERNAL_FUNCTION_PARAMETERS)
|
|||
ulong ret;
|
||||
unsigned int uval;
|
||||
my_ulonglong llval;
|
||||
|
||||
|
||||
|
||||
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
MYSQLI_FETCH_RESOURCE_STMT(stmt, &mysql_stmt, MYSQLI_STATUS_VALID);
|
||||
|
||||
|
||||
/* reset buffers */
|
||||
for (i = 0; i < stmt->result.var_cnt; i++) {
|
||||
if (stmt->result.buf[i].type == IS_STRING) {
|
||||
|
@ -888,7 +888,7 @@ void mysqli_stmt_fetch_libmysql(INTERNAL_FUNCTION_PARAMETERS)
|
|||
if (!stmt->result.is_null[i]) {
|
||||
switch (stmt->result.buf[i].type) {
|
||||
case IS_LONG:
|
||||
if ((stmt->stmt->fields[i].type == MYSQL_TYPE_LONG)
|
||||
if ((stmt->stmt->fields[i].type == MYSQL_TYPE_LONG)
|
||||
&& (stmt->stmt->fields[i].flags & UNSIGNED_FLAG))
|
||||
{
|
||||
/* unsigned int (11) */
|
||||
|
@ -899,7 +899,7 @@ void mysqli_stmt_fetch_libmysql(INTERNAL_FUNCTION_PARAMETERS)
|
|||
int j=10;
|
||||
tmp= emalloc(11);
|
||||
p= &tmp[9];
|
||||
do {
|
||||
do {
|
||||
*p-- = (uval % 10) + 48;
|
||||
uval = uval / 10;
|
||||
} while (--j > 0);
|
||||
|
@ -910,7 +910,7 @@ void mysqli_stmt_fetch_libmysql(INTERNAL_FUNCTION_PARAMETERS)
|
|||
}
|
||||
#endif
|
||||
}
|
||||
if (stmt->stmt->fields[i].flags & UNSIGNED_FLAG) {
|
||||
if (stmt->stmt->fields[i].flags & UNSIGNED_FLAG) {
|
||||
ZVAL_LONG(stmt->result.vars[i], *(unsigned int *)stmt->result.buf[i].val);
|
||||
} else {
|
||||
ZVAL_LONG(stmt->result.vars[i], *(int *)stmt->result.buf[i].val);
|
||||
|
@ -946,7 +946,7 @@ void mysqli_stmt_fetch_libmysql(INTERNAL_FUNCTION_PARAMETERS)
|
|||
#if SIZEOF_LONG==8
|
||||
if (uns && llval > 9223372036854775807L) {
|
||||
#elif SIZEOF_LONG==4
|
||||
if ((uns && llval > L64(2147483647)) ||
|
||||
if ((uns && llval > L64(2147483647)) ||
|
||||
(!uns && (( L64(2147483647) < (my_longlong) llval) ||
|
||||
(L64(-2147483648) > (my_longlong) llval))))
|
||||
{
|
||||
|
@ -991,7 +991,7 @@ void mysqli_stmt_fetch_libmysql(INTERNAL_FUNCTION_PARAMETERS)
|
|||
case 0:
|
||||
#ifdef MYSQL_DATA_TRUNCATED
|
||||
/* according to SQL standard truncation (e.g. loss of precision is
|
||||
not an error) - for detecting possible truncation you have to
|
||||
not an error) - for detecting possible truncation you have to
|
||||
check mysqli_stmt_warning
|
||||
*/
|
||||
case MYSQL_DATA_TRUNCATED:
|
||||
|
@ -1064,7 +1064,7 @@ static void php_add_field_properties(zval *value, const MYSQL_FIELD *field TSRML
|
|||
|
||||
/* {{{ proto mixed mysqli_fetch_field (object result)
|
||||
Get column information from a result and return as an object */
|
||||
PHP_FUNCTION(mysqli_fetch_field)
|
||||
PHP_FUNCTION(mysqli_fetch_field)
|
||||
{
|
||||
MYSQL_RES *result;
|
||||
zval *mysql_result;
|
||||
|
@ -1087,7 +1087,7 @@ PHP_FUNCTION(mysqli_fetch_field)
|
|||
|
||||
/* {{{ proto mixed mysqli_fetch_fields (object result)
|
||||
Return array of objects containing field meta-data */
|
||||
PHP_FUNCTION(mysqli_fetch_fields)
|
||||
PHP_FUNCTION(mysqli_fetch_fields)
|
||||
{
|
||||
MYSQL_RES *result;
|
||||
zval *mysql_result;
|
||||
|
@ -1117,7 +1117,7 @@ PHP_FUNCTION(mysqli_fetch_fields)
|
|||
|
||||
/* {{{ proto mixed mysqli_fetch_field_direct (object result, int offset)
|
||||
Fetch meta-data for a single field */
|
||||
PHP_FUNCTION(mysqli_fetch_field_direct)
|
||||
PHP_FUNCTION(mysqli_fetch_field_direct)
|
||||
{
|
||||
MYSQL_RES *result;
|
||||
zval *mysql_result;
|
||||
|
@ -1129,10 +1129,10 @@ PHP_FUNCTION(mysqli_fetch_field_direct)
|
|||
}
|
||||
|
||||
MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, &mysql_result, "mysqli_result", MYSQLI_STATUS_VALID);
|
||||
|
||||
|
||||
if (offset < 0 || offset >= (long) mysql_num_fields(result)) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Field offset is invalid for resultset");
|
||||
RETURN_FALSE;
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (!(field = mysql_fetch_field_direct(result,offset))) {
|
||||
|
@ -1146,7 +1146,7 @@ PHP_FUNCTION(mysqli_fetch_field_direct)
|
|||
|
||||
/* {{{ proto mixed mysqli_fetch_lengths (object result)
|
||||
Get the length of each output in a result */
|
||||
PHP_FUNCTION(mysqli_fetch_lengths)
|
||||
PHP_FUNCTION(mysqli_fetch_lengths)
|
||||
{
|
||||
MYSQL_RES *result;
|
||||
zval *mysql_result;
|
||||
|
@ -1173,7 +1173,7 @@ PHP_FUNCTION(mysqli_fetch_lengths)
|
|||
|
||||
/* {{{ proto array mysqli_fetch_row (object result)
|
||||
Get a result row as an enumerated array */
|
||||
PHP_FUNCTION(mysqli_fetch_row)
|
||||
PHP_FUNCTION(mysqli_fetch_row)
|
||||
{
|
||||
php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, MYSQLI_NUM, 0);
|
||||
}
|
||||
|
@ -1212,7 +1212,7 @@ PHP_FUNCTION(mysqli_field_seek)
|
|||
|
||||
if (fieldnr < 0 || fieldnr >= mysql_num_fields(result)) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid field offset");
|
||||
RETURN_FALSE;
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
mysql_field_seek(result, fieldnr);
|
||||
|
@ -1238,7 +1238,7 @@ PHP_FUNCTION(mysqli_field_tell)
|
|||
|
||||
/* {{{ proto void mysqli_free_result(object result)
|
||||
Free query result memory for the given result handle */
|
||||
PHP_FUNCTION(mysqli_free_result)
|
||||
PHP_FUNCTION(mysqli_free_result)
|
||||
{
|
||||
MYSQL_RES *result;
|
||||
zval *mysql_result;
|
||||
|
@ -1269,7 +1269,7 @@ PHP_FUNCTION(mysqli_get_client_version)
|
|||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto string mysqli_get_host_info (object link)
|
||||
/* {{{ proto string mysqli_get_host_info (object link)
|
||||
Get MySQL host info */
|
||||
PHP_FUNCTION(mysqli_get_host_info)
|
||||
{
|
||||
|
@ -1317,7 +1317,7 @@ PHP_FUNCTION(mysqli_get_server_info)
|
|||
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto int mysqli_get_server_version(object link)
|
||||
/* {{{ proto int mysqli_get_server_version(object link)
|
||||
Return the MySQL version for the server referenced by the given link */
|
||||
PHP_FUNCTION(mysqli_get_server_version)
|
||||
{
|
||||
|
@ -1383,7 +1383,7 @@ void php_mysqli_init(INTERNAL_FUNCTION_PARAMETERS)
|
|||
mysqli_resource->status = MYSQLI_STATUS_INITIALIZED;
|
||||
|
||||
if (!getThis() || !instanceof_function(Z_OBJCE_P(getThis()), mysqli_link_class_entry TSRMLS_CC)) {
|
||||
MYSQLI_RETURN_RESOURCE(mysqli_resource, mysqli_link_class_entry);
|
||||
MYSQLI_RETURN_RESOURCE(mysqli_resource, mysqli_link_class_entry);
|
||||
} else {
|
||||
((mysqli_object *) zend_object_store_get_object(getThis() TSRMLS_CC))->ptr = mysqli_resource;
|
||||
}
|
||||
|
@ -1656,7 +1656,7 @@ static int mysqli_options_get_option_zval_type(int option)
|
|||
case MYSQL_OPT_COMPRESS:
|
||||
#endif /* mysqlnd @ PHP 5.3.2 */
|
||||
#ifdef MYSQL_OPT_SSL_VERIFY_SERVER_CERT
|
||||
REGISTER_LONG_CONSTANT("MYSQLI_OPT_SSL_VERIFY_SERVER_CERT", MYSQL_OPT_SSL_VERIFY_SERVER_CERT, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("MYSQLI_OPT_SSL_VERIFY_SERVER_CERT", MYSQL_OPT_SSL_VERIFY_SERVER_CERT, CONST_CS | CONST_PERSISTENT);
|
||||
#endif /* MySQL 5.1.1., mysqlnd @ PHP 5.3.3 */
|
||||
return IS_LONG;
|
||||
|
||||
|
@ -1835,7 +1835,7 @@ PHP_FUNCTION(mysqli_prepare)
|
|||
|
||||
|
||||
/* {{{ proto bool mysqli_real_connect(object link [,string hostname [,string username [,string passwd [,string dbname [,int port [,string socket [,int flags]]]]]]])
|
||||
Open a connection to a mysql server */
|
||||
Open a connection to a mysql server */
|
||||
PHP_FUNCTION(mysqli_real_connect)
|
||||
{
|
||||
mysqli_common_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU, TRUE, FALSE);
|
||||
|
@ -1874,7 +1874,7 @@ PHP_FUNCTION(mysqli_real_query)
|
|||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto string mysqli_real_escape_string(object link, string escapestr)
|
||||
/* {{{ proto string mysqli_real_escape_string(object link, string escapestr)
|
||||
Escapes special characters in a string for use in a SQL statement, taking into account the current charset of the connection */
|
||||
PHP_FUNCTION(mysqli_real_escape_string) {
|
||||
MY_MYSQL *mysql;
|
||||
|
@ -1884,7 +1884,7 @@ PHP_FUNCTION(mysqli_real_escape_string) {
|
|||
|
||||
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &mysql_link, mysqli_link_class_entry, &escapestr, &escapestr_len) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
MYSQLI_FETCH_RESOURCE_CONN(mysql, &mysql_link, MYSQLI_STATUS_VALID);
|
||||
|
||||
newstr = safe_emalloc(2, escapestr_len, 1);
|
||||
|
@ -2010,19 +2010,19 @@ PHP_FUNCTION(mysqli_stmt_field_count)
|
|||
{
|
||||
MY_STMT *stmt;
|
||||
zval *mysql_stmt;
|
||||
|
||||
|
||||
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
MYSQLI_FETCH_RESOURCE_STMT(stmt, &mysql_stmt, MYSQLI_STATUS_VALID);
|
||||
|
||||
|
||||
RETURN_LONG(mysql_stmt_field_count(stmt->stmt));
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto void mysqli_stmt_free_result(object stmt)
|
||||
Free stored result memory for the given statement handle */
|
||||
PHP_FUNCTION(mysqli_stmt_free_result)
|
||||
PHP_FUNCTION(mysqli_stmt_free_result)
|
||||
{
|
||||
MY_STMT *stmt;
|
||||
zval *mysql_stmt;
|
||||
|
@ -2065,7 +2065,7 @@ PHP_FUNCTION(mysqli_stmt_param_count)
|
|||
return;
|
||||
}
|
||||
MYSQLI_FETCH_RESOURCE_STMT(stmt, &mysql_stmt, MYSQLI_STATUS_VALID);
|
||||
|
||||
|
||||
RETURN_LONG(mysql_stmt_param_count(stmt->stmt));
|
||||
}
|
||||
/* }}} */
|
||||
|
@ -2111,7 +2111,7 @@ PHP_FUNCTION(mysqli_stmt_num_rows)
|
|||
|
||||
/* {{{ proto bool mysqli_select_db(object link, string dbname)
|
||||
Select a MySQL database */
|
||||
PHP_FUNCTION(mysqli_select_db)
|
||||
PHP_FUNCTION(mysqli_select_db)
|
||||
{
|
||||
MY_MYSQL *mysql;
|
||||
zval *mysql_link;
|
||||
|
@ -2120,7 +2120,7 @@ PHP_FUNCTION(mysqli_select_db)
|
|||
|
||||
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &mysql_link, mysqli_link_class_entry, &dbname, &dbname_len) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
MYSQLI_FETCH_RESOURCE_CONN(mysql, &mysql_link, MYSQLI_STATUS_VALID);
|
||||
|
||||
if (mysql_select_db(mysql->mysql, dbname)) {
|
||||
|
@ -2133,7 +2133,7 @@ PHP_FUNCTION(mysqli_select_db)
|
|||
|
||||
/* {{{ proto string mysqli_sqlstate(object link)
|
||||
Returns the SQLSTATE error from previous MySQL operation */
|
||||
PHP_FUNCTION(mysqli_sqlstate)
|
||||
PHP_FUNCTION(mysqli_sqlstate)
|
||||
{
|
||||
MY_MYSQL *mysql;
|
||||
zval *mysql_link;
|
||||
|
@ -2171,8 +2171,8 @@ PHP_FUNCTION(mysqli_ssl_set)
|
|||
RETURN_TRUE;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto mixed mysqli_stat(object link)
|
||||
|
||||
/* {{{ proto mixed mysqli_stat(object link)
|
||||
Get current system status */
|
||||
PHP_FUNCTION(mysqli_stat)
|
||||
{
|
||||
|
@ -2223,7 +2223,7 @@ PHP_FUNCTION(mysqli_refresh)
|
|||
#endif
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
/* {{{ proto int mysqli_stmt_attr_set(object stmt, long attr, long mode)
|
||||
*/
|
||||
PHP_FUNCTION(mysqli_stmt_attr_set)
|
||||
|
@ -2300,7 +2300,7 @@ PHP_FUNCTION(mysqli_stmt_errno)
|
|||
|
||||
/* {{{ proto string mysqli_stmt_error(object stmt)
|
||||
*/
|
||||
PHP_FUNCTION(mysqli_stmt_error)
|
||||
PHP_FUNCTION(mysqli_stmt_error)
|
||||
{
|
||||
MY_STMT *stmt;
|
||||
zval *mysql_stmt;
|
||||
|
@ -2309,7 +2309,7 @@ PHP_FUNCTION(mysqli_stmt_error)
|
|||
return;
|
||||
}
|
||||
MYSQLI_FETCH_RESOURCE_STMT(stmt, &mysql_stmt, MYSQLI_STATUS_INITIALIZED);
|
||||
|
||||
|
||||
RETURN_STRING((char *)mysql_stmt_error(stmt->stmt),1);
|
||||
}
|
||||
/* }}} */
|
||||
|
@ -2405,7 +2405,7 @@ PHP_FUNCTION(mysqli_stmt_store_result)
|
|||
return;
|
||||
}
|
||||
MYSQLI_FETCH_RESOURCE_STMT(stmt, &mysql_stmt, MYSQLI_STATUS_VALID);
|
||||
|
||||
|
||||
#if !defined(MYSQLI_USE_MYSQLND)
|
||||
{
|
||||
/*
|
||||
|
@ -2430,7 +2430,7 @@ PHP_FUNCTION(mysqli_stmt_store_result)
|
|||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
if (mysql_stmt_store_result(stmt->stmt)){
|
||||
MYSQLI_REPORT_STMT_ERROR(stmt->stmt);
|
||||
RETURN_FALSE;
|
||||
|
|
|
@ -53,7 +53,7 @@ PHP_FUNCTION(mysqli_embedded_server_start)
|
|||
/* get arguments */
|
||||
if ((argc = zend_hash_num_elements(HASH_OF(args)))) {
|
||||
arguments = safe_emalloc(sizeof(char *), argc + 1, 0);
|
||||
arguments[0] = NULL;
|
||||
arguments[0] = NULL;
|
||||
|
||||
zend_hash_internal_pointer_reset_ex(HASH_OF(args), &pos);
|
||||
|
||||
|
@ -74,7 +74,7 @@ PHP_FUNCTION(mysqli_embedded_server_start)
|
|||
/* get groups */
|
||||
if ((zend_hash_num_elements(HASH_OF(grps)))) {
|
||||
groups = safe_emalloc(sizeof(char *), zend_hash_num_elements(HASH_OF(grps)) + 1, 0);
|
||||
groups[0] = NULL;
|
||||
groups[0] = NULL;
|
||||
|
||||
zend_hash_internal_pointer_reset_ex(HASH_OF(grps), &pos);
|
||||
|
||||
|
@ -89,7 +89,7 @@ PHP_FUNCTION(mysqli_embedded_server_start)
|
|||
|
||||
groups[++index] = Z_STRVAL_PP(item);
|
||||
}
|
||||
groups[index] = NULL;
|
||||
groups[index] = NULL;
|
||||
} else {
|
||||
groups = safe_emalloc(sizeof(char *), 1, 0);
|
||||
groups[0] = NULL;
|
||||
|
|
|
@ -36,13 +36,13 @@ const zend_function_entry mysqli_exception_methods[] = {
|
|||
};
|
||||
/* }}} */
|
||||
|
||||
void php_mysqli_throw_sql_exception(char *sqlstate, int errorno TSRMLS_DC, char *format, ...)
|
||||
void php_mysqli_throw_sql_exception(char *sqlstate, int errorno TSRMLS_DC, char *format, ...)
|
||||
{
|
||||
zval *sql_ex;
|
||||
va_list arg;
|
||||
char *message;
|
||||
|
||||
va_start(arg, format);
|
||||
va_start(arg, format);
|
||||
vspprintf(&message, 0, format, arg);
|
||||
va_end(arg);;
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
| Ulf Wendel <uw@php.net> |
|
||||
+----------------------------------------------------------------------+
|
||||
|
||||
$Id$
|
||||
$Id$
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
|
@ -362,7 +362,7 @@ const zend_function_entry mysqli_functions[] = {
|
|||
PHP_FE(mysqli_fetch_all, arginfo_mysqli_only_result)
|
||||
#endif
|
||||
PHP_FE(mysqli_fetch_array, arginfo_mysqli_fetch_array)
|
||||
PHP_FE(mysqli_fetch_assoc, arginfo_mysqli_only_result)
|
||||
PHP_FE(mysqli_fetch_assoc, arginfo_mysqli_only_result)
|
||||
PHP_FE(mysqli_fetch_object, arginfo_mysqli_fetch_object)
|
||||
PHP_FE(mysqli_fetch_row, arginfo_mysqli_only_result)
|
||||
PHP_FE(mysqli_field_count, arginfo_mysqli_only_link)
|
||||
|
@ -373,7 +373,7 @@ const zend_function_entry mysqli_functions[] = {
|
|||
PHP_FE(mysqli_get_connection_stats, arginfo_mysqli_only_link)
|
||||
PHP_FE(mysqli_get_client_stats, arginfo_mysqli_no_params)
|
||||
#endif
|
||||
#ifdef HAVE_MYSQLI_GET_CHARSET
|
||||
#ifdef HAVE_MYSQLI_GET_CHARSET
|
||||
PHP_FE(mysqli_get_charset, arginfo_mysqli_only_link)
|
||||
#endif
|
||||
PHP_FE(mysqli_get_client_info, arginfo_mysqli_only_link)
|
||||
|
@ -477,7 +477,7 @@ const zend_function_entry mysqli_link_methods[] = {
|
|||
PHP_FALIAS(connect, mysqli_connect, arginfo_mysqli_connect)
|
||||
PHP_FALIAS(dump_debug_info, mysqli_dump_debug_info, arginfo_mysqli_no_params)
|
||||
PHP_FALIAS(debug, mysqli_debug, arginfo_mysqli_debug)
|
||||
#ifdef HAVE_MYSQLI_GET_CHARSET
|
||||
#ifdef HAVE_MYSQLI_GET_CHARSET
|
||||
PHP_FALIAS(get_charset, mysqli_get_charset, arginfo_mysqli_no_params)
|
||||
#endif
|
||||
PHP_FALIAS(get_client_info, mysqli_get_client_info, arginfo_mysqli_no_params)
|
||||
|
@ -543,8 +543,8 @@ const zend_function_entry mysqli_result_methods[] = {
|
|||
PHP_FALIAS(fetch_all, mysqli_fetch_all, arginfo_mysqli_no_params)
|
||||
#endif
|
||||
PHP_FALIAS(fetch_array, mysqli_fetch_array, arginfo_class_mysqli_fetch_array)
|
||||
PHP_FALIAS(fetch_assoc, mysqli_fetch_assoc, arginfo_mysqli_no_params)
|
||||
PHP_FALIAS(fetch_object,mysqli_fetch_object, arginfo_class_mysqli_fetch_object)
|
||||
PHP_FALIAS(fetch_assoc, mysqli_fetch_assoc, arginfo_mysqli_no_params)
|
||||
PHP_FALIAS(fetch_object,mysqli_fetch_object, arginfo_class_mysqli_fetch_object)
|
||||
PHP_FALIAS(fetch_row, mysqli_fetch_row, arginfo_mysqli_no_params)
|
||||
PHP_FALIAS(field_seek, mysqli_field_seek, arginfo_class_mysqli_result_and_fieldnr)
|
||||
PHP_FALIAS(free_result, mysqli_free_result, arginfo_mysqli_no_params)
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
Andrey Hristov <andrey@php.net> |
|
||||
+----------------------------------------------------------------------+
|
||||
|
||||
$Id: php_mysqli_structs.h 302179 2010-08-13 09:57:04Z andrey $
|
||||
$Id: php_mysqli_structs.h 302179 2010-08-13 09:57:04Z andrey $
|
||||
*/
|
||||
|
||||
#ifndef MYSQLI_FE_H
|
||||
|
@ -151,7 +151,7 @@ PHP_METHOD(mysqli_warning,__construct);
|
|||
Andrey Hristov <andrey@php.net> |
|
||||
+----------------------------------------------------------------------+
|
||||
|
||||
$Id: php_mysqli_structs.h 302179 2010-08-13 09:57:04Z andrey $
|
||||
$Id: php_mysqli_structs.h 302179 2010-08-13 09:57:04Z andrey $
|
||||
*/
|
||||
|
||||
#ifndef MYSQLI_FE_H
|
||||
|
@ -267,4 +267,4 @@ PHP_FUNCTION(mysqli_result_construct);
|
|||
PHP_FUNCTION(mysqli_driver_construct);
|
||||
PHP_METHOD(mysqli_warning,__construct);
|
||||
|
||||
#endif /* MYSQLI_FE_H */
|
||||
#endif /* MYSQLI_FE_H */
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
|
||||
/*
|
||||
These functions also reside in ext/mysqlnd/mysqlnd_portability.h but since it is only made
|
||||
available if one wants to build mysqli against mysqlnd and they are useful for libmysql as
|
||||
available if one wants to build mysqli against mysqlnd and they are useful for libmysql as
|
||||
well, we check whether they're not defined [build with libmysql is desired] and define them.
|
||||
|
||||
Bit values are sent in reverted order of bytes, compared to normal !!!
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
| Ulf Wendel <uw@php.net> |
|
||||
+----------------------------------------------------------------------+
|
||||
|
||||
$Id$
|
||||
$Id$
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
|
@ -47,7 +47,7 @@ static void php_mysqli_set_error(long mysql_errno, char *mysql_err TSRMLS_DC)
|
|||
if (MyG(error_msg)) {
|
||||
efree(MyG(error_msg));
|
||||
}
|
||||
if(mysql_err && *mysql_err) {
|
||||
if(mysql_err && *mysql_err) {
|
||||
MyG(error_msg) = estrdup(mysql_err);
|
||||
} else {
|
||||
MyG(error_msg) = NULL;
|
||||
|
@ -88,7 +88,7 @@ void mysqli_common_connect(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_real_conne
|
|||
hostname = username = dbname = passwd = socket = NULL;
|
||||
|
||||
if (!is_real_connect) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|ssssls", &hostname, &hostname_len, &username, &username_len,
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|ssssls", &hostname, &hostname_len, &username, &username_len,
|
||||
&passwd, &passwd_len, &dbname, &dbname_len, &port, &socket, &socket_len) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
@ -149,12 +149,12 @@ void mysqli_common_connect(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_real_conne
|
|||
if (strlen(SAFE_STR(hostname)) > 2 && !strncasecmp(hostname, "p:", 2)) {
|
||||
hostname += 2;
|
||||
if (!MyG(allow_persistent)) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Persistent connections are disabled. Downgrading to normal");
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Persistent connections are disabled. Downgrading to normal");
|
||||
} else {
|
||||
mysql->persistent = persistent = TRUE;
|
||||
|
||||
hash_len = spprintf(&hash_key, 0, "mysqli_%s_%s%ld%s%s%s", SAFE_STR(hostname), SAFE_STR(socket),
|
||||
port, SAFE_STR(username), SAFE_STR(dbname),
|
||||
hash_len = spprintf(&hash_key, 0, "mysqli_%s_%s%ld%s%s%s", SAFE_STR(hostname), SAFE_STR(socket),
|
||||
port, SAFE_STR(username), SAFE_STR(dbname),
|
||||
SAFE_STR(passwd));
|
||||
|
||||
mysql->hash_key = hash_key;
|
||||
|
@ -278,7 +278,7 @@ end:
|
|||
mysql->multi_query = 0;
|
||||
|
||||
if (!object || !instanceof_function(Z_OBJCE_P(object), mysqli_link_class_entry TSRMLS_CC)) {
|
||||
MYSQLI_RETURN_RESOURCE(mysqli_resource, mysqli_link_class_entry);
|
||||
MYSQLI_RETURN_RESOURCE(mysqli_resource, mysqli_link_class_entry);
|
||||
} else {
|
||||
((mysqli_object *) zend_object_store_get_object(object TSRMLS_CC))->ptr = mysqli_resource;
|
||||
}
|
||||
|
@ -302,7 +302,7 @@ err:
|
|||
|
||||
|
||||
/* {{{ proto object mysqli_connect([string hostname [,string username [,string passwd [,string dbname [,int port [,string socket]]]]]])
|
||||
Open a connection to a mysql server */
|
||||
Open a connection to a mysql server */
|
||||
PHP_FUNCTION(mysqli_connect)
|
||||
{
|
||||
mysqli_common_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU, FALSE, FALSE);
|
||||
|
@ -311,7 +311,7 @@ PHP_FUNCTION(mysqli_connect)
|
|||
|
||||
|
||||
/* {{{ proto object mysqli_link_construct()
|
||||
*/
|
||||
*/
|
||||
PHP_FUNCTION(mysqli_link_construct)
|
||||
{
|
||||
mysqli_common_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU, FALSE, TRUE);
|
||||
|
@ -329,7 +329,7 @@ PHP_FUNCTION(mysqli_connect_errno)
|
|||
|
||||
/* {{{ proto string mysqli_connect_error(void)
|
||||
Returns the text of the error message from previous MySQL operation */
|
||||
PHP_FUNCTION(mysqli_connect_error)
|
||||
PHP_FUNCTION(mysqli_connect_error)
|
||||
{
|
||||
if (MyG(error_msg)) {
|
||||
RETURN_STRING(MyG(error_msg),1);
|
||||
|
@ -342,7 +342,7 @@ PHP_FUNCTION(mysqli_connect_error)
|
|||
|
||||
/* {{{ proto mixed mysqli_fetch_array (object result [,int resulttype])
|
||||
Fetch a result row as an associative array, a numeric array, or both */
|
||||
PHP_FUNCTION(mysqli_fetch_array)
|
||||
PHP_FUNCTION(mysqli_fetch_array)
|
||||
{
|
||||
php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0, 0);
|
||||
}
|
||||
|
@ -350,17 +350,17 @@ PHP_FUNCTION(mysqli_fetch_array)
|
|||
|
||||
/* {{{ proto mixed mysqli_fetch_assoc (object result)
|
||||
Fetch a result row as an associative array */
|
||||
PHP_FUNCTION(mysqli_fetch_assoc)
|
||||
PHP_FUNCTION(mysqli_fetch_assoc)
|
||||
{
|
||||
php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, MYSQLI_ASSOC, 0);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
/* {{{ proto mixed mysqli_fetch_all (object result [,int resulttype])
|
||||
/* {{{ proto mixed mysqli_fetch_all (object result [,int resulttype])
|
||||
Fetches all result rows as an associative array, a numeric array, or both */
|
||||
#if defined(MYSQLI_USE_MYSQLND)
|
||||
PHP_FUNCTION(mysqli_fetch_all)
|
||||
PHP_FUNCTION(mysqli_fetch_all)
|
||||
{
|
||||
MYSQL_RES *result;
|
||||
zval *mysql_result;
|
||||
|
@ -384,7 +384,7 @@ PHP_FUNCTION(mysqli_fetch_all)
|
|||
|
||||
/* {{{ proto array mysqli_get_client_stats(void)
|
||||
Returns statistics about the zval cache */
|
||||
PHP_FUNCTION(mysqli_get_client_stats)
|
||||
PHP_FUNCTION(mysqli_get_client_stats)
|
||||
{
|
||||
if (zend_parse_parameters_none() == FAILURE) {
|
||||
return;
|
||||
|
@ -396,7 +396,7 @@ PHP_FUNCTION(mysqli_get_client_stats)
|
|||
|
||||
/* {{{ proto array mysqli_get_connection_stats(void)
|
||||
Returns statistics about the zval cache */
|
||||
PHP_FUNCTION(mysqli_get_connection_stats)
|
||||
PHP_FUNCTION(mysqli_get_connection_stats)
|
||||
{
|
||||
MY_MYSQL *mysql;
|
||||
zval *mysql_link;
|
||||
|
@ -415,9 +415,9 @@ PHP_FUNCTION(mysqli_get_connection_stats)
|
|||
|
||||
/* {{{ proto mixed mysqli_fetch_object (object result [, string class_name [, NULL|array ctor_params]])
|
||||
Fetch a result row as an object */
|
||||
PHP_FUNCTION(mysqli_fetch_object)
|
||||
PHP_FUNCTION(mysqli_fetch_object)
|
||||
{
|
||||
php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, MYSQLI_ASSOC, 1);
|
||||
php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, MYSQLI_ASSOC, 1);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
@ -435,12 +435,12 @@ PHP_FUNCTION(mysqli_multi_query)
|
|||
}
|
||||
MYSQLI_FETCH_RESOURCE_CONN(mysql, &mysql_link, MYSQLI_STATUS_VALID);
|
||||
|
||||
MYSQLI_ENABLE_MQ;
|
||||
MYSQLI_ENABLE_MQ;
|
||||
if (mysql_real_query(mysql->mysql, query, query_len)) {
|
||||
#ifndef MYSQLI_USE_MYSQLND
|
||||
char s_error[MYSQL_ERRMSG_SIZE], s_sqlstate[SQLSTATE_LENGTH+1];
|
||||
unsigned int s_errno;
|
||||
/* we have to save error information, cause
|
||||
/* we have to save error information, cause
|
||||
MYSQLI_DISABLE_MQ will reset error information */
|
||||
strcpy(s_error, mysql_error(mysql->mysql));
|
||||
strcpy(s_sqlstate, mysql_sqlstate(mysql->mysql));
|
||||
|
@ -455,7 +455,7 @@ PHP_FUNCTION(mysqli_multi_query)
|
|||
/* restore error information */
|
||||
strcpy(mysql->mysql->net.last_error, s_error);
|
||||
strcpy(mysql->mysql->net.sqlstate, s_sqlstate);
|
||||
mysql->mysql->net.last_errno = s_errno;
|
||||
mysql->mysql->net.last_errno = s_errno;
|
||||
#else
|
||||
mysql->mysql->error_info = error_info;
|
||||
#endif
|
||||
|
@ -528,7 +528,7 @@ PHP_FUNCTION(mysqli_query)
|
|||
}
|
||||
if (!result) {
|
||||
php_mysqli_throw_sql_exception((char *)mysql_sqlstate(mysql->mysql), mysql_errno(mysql->mysql) TSRMLS_CC,
|
||||
"%s", mysql_error(mysql->mysql));
|
||||
"%s", mysql_error(mysql->mysql));
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
|
@ -562,7 +562,7 @@ static int mysqlnd_zval_array_to_mysqlnd_array(zval *in_array, MYSQLND ***out_ar
|
|||
i++;
|
||||
if (Z_TYPE_PP(elem) != IS_OBJECT ||
|
||||
!instanceof_function(Z_OBJCE_PP(elem), mysqli_link_class_entry TSRMLS_CC)) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Parameter %d not a mysqli object", i);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Parameter %d not a mysqli object", i);
|
||||
} else {
|
||||
MY_MYSQL *mysql;
|
||||
MYSQLI_RESOURCE *my_res;
|
||||
|
@ -762,7 +762,7 @@ PHP_FUNCTION(mysqli_reap_async_query)
|
|||
|
||||
if (!result) {
|
||||
php_mysqli_throw_sql_exception((char *)mysql_sqlstate(mysql->mysql), mysql_errno(mysql->mysql) TSRMLS_CC,
|
||||
"%s", mysql_error(mysql->mysql));
|
||||
"%s", mysql_error(mysql->mysql));
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
|
@ -800,7 +800,7 @@ PHP_FUNCTION(mysqli_stmt_get_result)
|
|||
mysqli_resource = (MYSQLI_RESOURCE *)ecalloc (1, sizeof(MYSQLI_RESOURCE));
|
||||
mysqli_resource->ptr = (void *)result;
|
||||
mysqli_resource->status = MYSQLI_STATUS_VALID;
|
||||
MYSQLI_RETURN_RESOURCE(mysqli_resource, mysqli_result_class_entry);
|
||||
MYSQLI_RETURN_RESOURCE(mysqli_resource, mysqli_result_class_entry);
|
||||
}
|
||||
/* }}} */
|
||||
#endif
|
||||
|
@ -820,14 +820,14 @@ PHP_FUNCTION(mysqli_get_warnings)
|
|||
MYSQLI_FETCH_RESOURCE_CONN(mysql, &mysql_link, MYSQLI_STATUS_VALID);
|
||||
|
||||
if (mysql_warning_count(mysql->mysql)) {
|
||||
w = php_get_warnings(mysql->mysql TSRMLS_CC);
|
||||
w = php_get_warnings(mysql->mysql TSRMLS_CC);
|
||||
} else {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
mysqli_resource = (MYSQLI_RESOURCE *)ecalloc (1, sizeof(MYSQLI_RESOURCE));
|
||||
mysqli_resource->ptr = mysqli_resource->info = (void *)w;
|
||||
mysqli_resource->status = MYSQLI_STATUS_VALID;
|
||||
MYSQLI_RETURN_RESOURCE(mysqli_resource, mysqli_warning_class_entry);
|
||||
MYSQLI_RETURN_RESOURCE(mysqli_resource, mysqli_warning_class_entry);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
@ -845,7 +845,7 @@ PHP_FUNCTION(mysqli_stmt_get_warnings)
|
|||
MYSQLI_FETCH_RESOURCE_STMT(stmt, &stmt_link, MYSQLI_STATUS_VALID);
|
||||
|
||||
if (mysqli_stmt_warning_count(stmt->stmt)) {
|
||||
w = php_get_warnings(mysqli_stmt_get_connection(stmt->stmt) TSRMLS_CC);
|
||||
w = php_get_warnings(mysqli_stmt_get_connection(stmt->stmt) TSRMLS_CC);
|
||||
} else {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
@ -879,7 +879,7 @@ PHP_FUNCTION(mysqli_set_charset)
|
|||
/* }}} */
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MYSQLI_GET_CHARSET
|
||||
#ifdef HAVE_MYSQLI_GET_CHARSET
|
||||
/* {{{ proto object mysqli_get_charset(object link) U
|
||||
returns a character set object */
|
||||
PHP_FUNCTION(mysqli_get_charset)
|
||||
|
@ -913,8 +913,8 @@ PHP_FUNCTION(mysqli_get_charset)
|
|||
comment = cs.comment;
|
||||
#else
|
||||
cs = mysql->mysql->charset;
|
||||
name = cs->name;
|
||||
collation = cs->collation;
|
||||
name = cs->name;
|
||||
collation = cs->collation;
|
||||
minlength = cs->char_minlen;
|
||||
maxlength = cs->char_maxlen;
|
||||
number = cs->nr;
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
| Author: Georg Richter <georg@php.net> |
|
||||
+----------------------------------------------------------------------+
|
||||
|
||||
$Id: php_mysqli_structs.h 302179 2010-08-13 09:57:04Z andrey $
|
||||
$Id: php_mysqli_structs.h 302179 2010-08-13 09:57:04Z andrey $
|
||||
*/
|
||||
|
||||
#ifndef MYSQLI_PRIV_H
|
||||
|
@ -93,12 +93,12 @@ PHP_MYSQLI_EXPORT(zend_object_value) mysqli_objects_new(zend_class_entry * TSRML
|
|||
#define MYSQLI_DISABLE_MQ if (mysql->multi_query) { \
|
||||
mysql_set_server_option(mysql->mysql, MYSQL_OPTION_MULTI_STATEMENTS_OFF); \
|
||||
mysql->multi_query = 0; \
|
||||
}
|
||||
}
|
||||
|
||||
#define MYSQLI_ENABLE_MQ if (!mysql->multi_query) { \
|
||||
mysql_set_server_option(mysql->mysql, MYSQL_OPTION_MULTI_STATEMENTS_ON); \
|
||||
mysql->multi_query = 1; \
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#define MYSQLI_RETURN_LONG_LONG(__val) \
|
||||
|
@ -136,7 +136,7 @@ PHP_MYSQLI_EXPORT(zend_object_value) mysqli_objects_new(zend_class_entry * TSRML
|
|||
#define MYSQLI_REPORT_ERROR 1
|
||||
#define MYSQLI_REPORT_STRICT 2
|
||||
#define MYSQLI_REPORT_INDEX 4
|
||||
#define MYSQLI_REPORT_CLOSE 8
|
||||
#define MYSQLI_REPORT_CLOSE 8
|
||||
#define MYSQLI_REPORT_ALL 255
|
||||
|
||||
#define MYSQLI_REPORT_MYSQL_ERROR(mysql) \
|
||||
|
@ -171,7 +171,7 @@ void php_mysqli_init(INTERNAL_FUNCTION_PARAMETERS);
|
|||
| Author: Georg Richter <georg@php.net> |
|
||||
+----------------------------------------------------------------------+
|
||||
|
||||
$Id: php_mysqli_structs.h 302179 2010-08-13 09:57:04Z andrey $
|
||||
$Id: php_mysqli_structs.h 302179 2010-08-13 09:57:04Z andrey $
|
||||
*/
|
||||
|
||||
#ifndef MYSQLI_PRIV_H
|
||||
|
@ -249,12 +249,12 @@ PHP_MYSQLI_EXPORT(zend_object_value) mysqli_objects_new(zend_class_entry * TSRML
|
|||
#define MYSQLI_DISABLE_MQ if (mysql->multi_query) { \
|
||||
mysql_set_server_option(mysql->mysql, MYSQL_OPTION_MULTI_STATEMENTS_OFF); \
|
||||
mysql->multi_query = 0; \
|
||||
}
|
||||
}
|
||||
|
||||
#define MYSQLI_ENABLE_MQ if (!mysql->multi_query) { \
|
||||
mysql_set_server_option(mysql->mysql, MYSQL_OPTION_MULTI_STATEMENTS_ON); \
|
||||
mysql->multi_query = 1; \
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#define MYSQLI_RETURN_LONG_LONG(__val) \
|
||||
|
@ -292,7 +292,7 @@ PHP_MYSQLI_EXPORT(zend_object_value) mysqli_objects_new(zend_class_entry * TSRML
|
|||
#define MYSQLI_REPORT_ERROR 1
|
||||
#define MYSQLI_REPORT_STRICT 2
|
||||
#define MYSQLI_REPORT_INDEX 4
|
||||
#define MYSQLI_REPORT_CLOSE 8
|
||||
#define MYSQLI_REPORT_CLOSE 8
|
||||
#define MYSQLI_REPORT_ALL 255
|
||||
|
||||
#define MYSQLI_REPORT_MYSQL_ERROR(mysql) \
|
||||
|
@ -309,4 +309,4 @@ void mysqli_common_connect(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_real_conne
|
|||
|
||||
void php_mysqli_init(INTERNAL_FUNCTION_PARAMETERS);
|
||||
|
||||
#endif /* MYSQLI_PRIV_H */
|
||||
#endif /* MYSQLI_PRIV_H */
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
| Author: Georg Richter <georg@php.net> |
|
||||
+----------------------------------------------------------------------+
|
||||
|
||||
$Id$
|
||||
$Id$
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
|
@ -159,12 +159,12 @@ static int link_affected_rows_read(mysqli_object *obj, zval **retval TSRMLS_DC)
|
|||
MY_MYSQL *mysql;
|
||||
my_ulonglong rc;
|
||||
|
||||
MAKE_STD_ZVAL(*retval);
|
||||
MAKE_STD_ZVAL(*retval);
|
||||
|
||||
CHECK_STATUS(MYSQLI_STATUS_INITIALIZED);
|
||||
|
||||
mysql = (MY_MYSQL *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr;
|
||||
|
||||
|
||||
if (!mysql) {
|
||||
ZVAL_NULL(*retval);
|
||||
} else {
|
||||
|
@ -175,7 +175,7 @@ static int link_affected_rows_read(mysqli_object *obj, zval **retval TSRMLS_DC)
|
|||
if (rc == (my_ulonglong) -1) {
|
||||
ZVAL_LONG(*retval, -1);
|
||||
return SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
if (rc < LONG_MAX) {
|
||||
ZVAL_LONG(*retval, rc);
|
||||
|
@ -259,7 +259,7 @@ static int stmt_id_read(mysqli_object *obj, zval **retval TSRMLS_DC)
|
|||
{
|
||||
MY_STMT *p;
|
||||
|
||||
MAKE_STD_ZVAL(*retval);
|
||||
MAKE_STD_ZVAL(*retval);
|
||||
CHECK_STATUS(MYSQLI_STATUS_VALID);
|
||||
|
||||
p = (MY_STMT*)((MYSQLI_RESOURCE *)(obj->ptr))->ptr;
|
||||
|
@ -279,7 +279,7 @@ static int stmt_affected_rows_read(mysqli_object *obj, zval **retval TSRMLS_DC)
|
|||
MY_STMT *p;
|
||||
my_ulonglong rc;
|
||||
|
||||
MAKE_STD_ZVAL(*retval);
|
||||
MAKE_STD_ZVAL(*retval);
|
||||
CHECK_STATUS(MYSQLI_STATUS_VALID);
|
||||
|
||||
p = (MY_STMT *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr;
|
||||
|
@ -288,12 +288,12 @@ static int stmt_affected_rows_read(mysqli_object *obj, zval **retval TSRMLS_DC)
|
|||
ZVAL_NULL(*retval);
|
||||
} else {
|
||||
rc = mysql_stmt_affected_rows(p->stmt);
|
||||
|
||||
|
||||
if (rc == (my_ulonglong) -1) {
|
||||
ZVAL_LONG(*retval, -1);
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (rc < LONG_MAX) {
|
||||
ZVAL_LONG(*retval, rc);
|
||||
} else {
|
||||
|
@ -333,7 +333,7 @@ const mysqli_property_entry mysqli_link_property_entries[] = {
|
|||
{"protocol_version",sizeof("protocol_version") - 1, link_protocol_version_read, NULL},
|
||||
{"thread_id", sizeof("thread_id") - 1, link_thread_id_read, NULL},
|
||||
{"warning_count", sizeof("warning_count") - 1, link_warning_count_read, NULL},
|
||||
{NULL, 0, NULL, NULL}
|
||||
{NULL, 0, NULL, NULL}
|
||||
};
|
||||
|
||||
/* should not be const, as it is patched during runtime */
|
||||
|
@ -355,7 +355,7 @@ zend_property_info mysqli_link_property_info_entries[] = {
|
|||
{ZEND_ACC_PUBLIC, "protocol_version", sizeof("protocol_version")-1, 0, NULL, 0, NULL},
|
||||
{ZEND_ACC_PUBLIC, "thread_id", sizeof("thread_id") - 1, 0, NULL, 0, NULL},
|
||||
{ZEND_ACC_PUBLIC, "warning_count", sizeof("warning_count") - 1, 0, NULL, 0, NULL},
|
||||
{0, NULL, 0, 0, NULL, 0, NULL}
|
||||
{0, NULL, 0, 0, NULL, 0, NULL}
|
||||
};
|
||||
|
||||
|
||||
|
@ -374,7 +374,7 @@ zend_property_info mysqli_result_property_info_entries[] = {
|
|||
{ZEND_ACC_PUBLIC, "lengths", sizeof("lengths") - 1, 0, NULL, 0, NULL},
|
||||
{ZEND_ACC_PUBLIC, "num_rows", sizeof("num_rows") - 1, 0, NULL, 0, NULL},
|
||||
{ZEND_ACC_PUBLIC, "type", sizeof("type") - 1, 0, NULL, 0, NULL},
|
||||
{0, NULL, 0, 0, NULL, 0, NULL}
|
||||
{0, NULL, 0, 0, NULL, 0, NULL}
|
||||
};
|
||||
|
||||
const mysqli_property_entry mysqli_stmt_property_entries[] = {
|
||||
|
@ -401,7 +401,7 @@ zend_property_info mysqli_stmt_property_info_entries[] = {
|
|||
{ZEND_ACC_PUBLIC, "error", sizeof("error") - 1, 0, NULL, 0, NULL},
|
||||
{ZEND_ACC_PUBLIC, "sqlstate", sizeof("sqlstate") - 1, 0, NULL, 0, NULL},
|
||||
{ZEND_ACC_PUBLIC, "id", sizeof("id") - 1, 0, NULL, 0, NULL},
|
||||
{0, NULL, 0, 0, NULL, 0, NULL}
|
||||
{0, NULL, 0, 0, NULL, 0, NULL}
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
| Author: Georg Richter <georg@php.net> |
|
||||
+----------------------------------------------------------------------+
|
||||
|
||||
$Id$
|
||||
$Id$
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
|
@ -33,7 +33,7 @@ PHP_FUNCTION(mysqli_report)
|
|||
{
|
||||
long flags;
|
||||
|
||||
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &flags) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
@ -44,14 +44,14 @@ PHP_FUNCTION(mysqli_report)
|
|||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ void php_mysqli_report_error(char *sqlstate, int errorno, char *error) */
|
||||
/* {{{ void php_mysqli_report_error(char *sqlstate, int errorno, char *error) */
|
||||
void php_mysqli_report_error(const char *sqlstate, int errorno, const char *error TSRMLS_DC)
|
||||
{
|
||||
php_mysqli_throw_sql_exception((char *)sqlstate, errorno TSRMLS_CC, "%s", error);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ void php_mysqli_report_index() */
|
||||
/* {{{ void php_mysqli_report_index() */
|
||||
void php_mysqli_report_index(const char *query, unsigned int status TSRMLS_DC) {
|
||||
char index[15];
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
| Ulf Wendel <uw@php.net> |
|
||||
+----------------------------------------------------------------------+
|
||||
|
||||
$Id: mysqli.c 299335 2010-05-13 11:05:09Z andrey $
|
||||
$Id: mysqli.c 299335 2010-05-13 11:05:09Z andrey $
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
|
@ -104,7 +104,7 @@ static void php_mysqli_result_iterator_current_data(zend_object_iterator *iter,
|
|||
/* {{{ */
|
||||
static void php_mysqli_result_iterator_move_forward(zend_object_iterator *iter TSRMLS_DC)
|
||||
{
|
||||
|
||||
|
||||
php_mysqli_result_iterator *iterator = (php_mysqli_result_iterator*) iter;
|
||||
mysqli_object *intern = iterator->result;
|
||||
MYSQL_RES *result;
|
||||
|
@ -161,7 +161,7 @@ static int php_mysqli_result_iterator_current_key(zend_object_iterator *iter, ch
|
|||
|
||||
|
||||
/* {{{ php_mysqli_result_iterator_funcs */
|
||||
zend_object_iterator_funcs php_mysqli_result_iterator_funcs = {
|
||||
zend_object_iterator_funcs php_mysqli_result_iterator_funcs = {
|
||||
php_mysqli_result_iterator_dtor,
|
||||
php_mysqli_result_iterator_valid,
|
||||
php_mysqli_result_iterator_current_data,
|
||||
|
|
|
@ -47,7 +47,7 @@ void php_clear_warnings(MYSQLI_WARNING *w)
|
|||
zval_dtor(&(w->sqlstate));
|
||||
w = w->next;
|
||||
efree(n);
|
||||
}
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
@ -62,7 +62,7 @@ MYSQLI_WARNING *php_new_warning(const char *reason, int errorno TSRMLS_DC)
|
|||
w = (MYSQLI_WARNING *)ecalloc(1, sizeof(MYSQLI_WARNING));
|
||||
|
||||
ZVAL_UTF8_STRING(&(w->reason), reason, ZSTR_DUPLICATE);
|
||||
|
||||
|
||||
ZVAL_UTF8_STRINGL(&(w->sqlstate), "HY000", sizeof("HY000") - 1, ZSTR_DUPLICATE);
|
||||
|
||||
w->errorno = errorno;
|
||||
|
@ -112,7 +112,7 @@ MYSQLI_WARNING *php_new_warning(const zval *reason, int errorno TSRMLS_DC)
|
|||
zval_copy_ctor(&(w->reason));
|
||||
|
||||
ZVAL_UTF8_STRINGL(&(w->reason), Z_STRVAL(w->reason), Z_STRLEN(w->reason), ZSTR_AUTOFREE);
|
||||
|
||||
|
||||
ZVAL_UTF8_STRINGL(&(w->sqlstate), "HY000", sizeof("HY000") - 1, ZSTR_DUPLICATE);
|
||||
|
||||
w->errorno = errorno;
|
||||
|
@ -183,14 +183,14 @@ MYSQLI_WARNING *php_get_warnings(MYSQL *mysql TSRMLS_DC)
|
|||
|
||||
|
||||
/* {{{ bool mysqli_warning::next() */
|
||||
PHP_METHOD(mysqli_warning, next)
|
||||
PHP_METHOD(mysqli_warning, next)
|
||||
{
|
||||
MYSQLI_WARNING *w;
|
||||
zval *mysqli_warning;
|
||||
mysqli_object *obj = (mysqli_object *)zend_objects_get_address(getThis() TSRMLS_CC);
|
||||
|
||||
if (obj->ptr) {
|
||||
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
|
||||
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
|
||||
&mysqli_warning, mysqli_warning_class_entry) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
@ -232,7 +232,7 @@ static
|
|||
int mysqli_warning_sqlstate(mysqli_object *obj, zval **retval TSRMLS_DC)
|
||||
{
|
||||
MYSQLI_WARNING *w;
|
||||
|
||||
|
||||
if (!obj->ptr || !((MYSQLI_RESOURCE *)(obj->ptr))->ptr) {
|
||||
return FAILURE;
|
||||
}
|
||||
|
@ -293,7 +293,7 @@ PHP_METHOD(mysqli_warning, __construct)
|
|||
}
|
||||
|
||||
if (mysql_warning_count(hdl)) {
|
||||
w = php_get_warnings(hdl TSRMLS_CC);
|
||||
w = php_get_warnings(hdl TSRMLS_CC);
|
||||
} else {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "No warnings found");
|
||||
RETURN_FALSE;
|
||||
|
@ -304,7 +304,7 @@ PHP_METHOD(mysqli_warning, __construct)
|
|||
mysqli_resource->status = MYSQLI_STATUS_VALID;
|
||||
|
||||
if (!getThis() || !instanceof_function(Z_OBJCE_P(getThis()), mysqli_warning_class_entry TSRMLS_CC)) {
|
||||
MYSQLI_RETURN_RESOURCE(mysqli_resource, mysqli_warning_class_entry);
|
||||
MYSQLI_RETURN_RESOURCE(mysqli_resource, mysqli_warning_class_entry);
|
||||
} else {
|
||||
((mysqli_object *) zend_object_store_get_object(getThis() TSRMLS_CC))->ptr = mysqli_resource;
|
||||
}
|
||||
|
@ -334,7 +334,7 @@ zend_property_info mysqli_warning_property_info_entries[] = {
|
|||
{ZEND_ACC_PUBLIC, "message", sizeof("message") - 1, 0, NULL, 0, NULL},
|
||||
{ZEND_ACC_PUBLIC, "sqlstate", sizeof("sqlstate") - 1, 0, NULL, 0, NULL},
|
||||
{ZEND_ACC_PUBLIC, "errno", sizeof("errno") - 1, 0, NULL, 0, NULL},
|
||||
{0, NULL, 0, 0, NULL, 0, NULL}
|
||||
{0, NULL, 0, 0, NULL, 0, NULL}
|
||||
};
|
||||
/* }}} */
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
| Ulf Wendel <uw@php.net> |
|
||||
+----------------------------------------------------------------------+
|
||||
|
||||
$Id$
|
||||
$Id$
|
||||
*/
|
||||
|
||||
#ifndef PHP_MYSQLI_H
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
| Ulf Wendel <uw@php.net> |
|
||||
+----------------------------------------------------------------------+
|
||||
|
||||
$Id$
|
||||
$Id$
|
||||
*/
|
||||
|
||||
#ifndef PHP_MYSQLI_STRUCTS_H
|
||||
|
@ -126,7 +126,7 @@ typedef struct {
|
|||
unsigned int multi_query;
|
||||
zend_bool persistent;
|
||||
#if defined(MYSQLI_USE_MYSQLND)
|
||||
int async_result_fetch_type;
|
||||
int async_result_fetch_type;
|
||||
#endif
|
||||
} MY_MYSQL;
|
||||
|
||||
|
@ -226,12 +226,12 @@ extern PHPAPI zend_class_entry *spl_ce_RuntimeException;
|
|||
#define MYSQLI_DISABLE_MQ if (mysql->multi_query) { \
|
||||
mysql_set_server_option(mysql->mysql, MYSQL_OPTION_MULTI_STATEMENTS_OFF); \
|
||||
mysql->multi_query = 0; \
|
||||
}
|
||||
}
|
||||
|
||||
#define MYSQLI_ENABLE_MQ if (!mysql->multi_query) { \
|
||||
mysql_set_server_option(mysql->mysql, MYSQL_OPTION_MULTI_STATEMENTS_ON); \
|
||||
mysql->multi_query = 1; \
|
||||
}
|
||||
}
|
||||
|
||||
#define REGISTER_MYSQLI_CLASS_ENTRY(name, mysqli_entry, class_functions) { \
|
||||
zend_class_entry ce; \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue