mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
WS fixes
This commit is contained in:
parent
1ab38567b9
commit
859a1404bf
12 changed files with 43 additions and 49 deletions
|
@ -280,7 +280,7 @@ MYSQLND_METHOD(mysqlnd_conn, simple_command_handle_response)(MYSQLND * conn, enu
|
||||||
MYSQLND_PACKET_EOF * ok_response = conn->protocol->m.get_eof_packet(conn->protocol, FALSE TSRMLS_CC);
|
MYSQLND_PACKET_EOF * ok_response = conn->protocol->m.get_eof_packet(conn->protocol, FALSE TSRMLS_CC);
|
||||||
if (!ok_response) {
|
if (!ok_response) {
|
||||||
SET_OOM_ERROR(conn->error_info);
|
SET_OOM_ERROR(conn->error_info);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (FAIL == (ret = PACKET_READ(ok_response, conn))) {
|
if (FAIL == (ret = PACKET_READ(ok_response, conn))) {
|
||||||
SET_CLIENT_ERROR(conn->error_info, CR_MALFORMED_PACKET, UNKNOWN_SQLSTATE,
|
SET_CLIENT_ERROR(conn->error_info, CR_MALFORMED_PACKET, UNKNOWN_SQLSTATE,
|
||||||
|
@ -477,7 +477,7 @@ mysqlnd_connect_run_authentication(
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
memcpy(auth_packet->server_scramble_buf, greet_packet->scramble_buf, SCRAMBLE_LENGTH);
|
memcpy(auth_packet->server_scramble_buf, greet_packet->scramble_buf, SCRAMBLE_LENGTH);
|
||||||
|
|
||||||
if (!PACKET_WRITE(auth_packet, conn)) {
|
if (!PACKET_WRITE(auth_packet, conn)) {
|
||||||
CONN_SET_STATE(conn, CONN_QUIT_SENT);
|
CONN_SET_STATE(conn, CONN_QUIT_SENT);
|
||||||
SET_CLIENT_ERROR(conn->error_info, CR_SERVER_GONE_ERROR, UNKNOWN_SQLSTATE, mysqlnd_server_gone);
|
SET_CLIENT_ERROR(conn->error_info, CR_SERVER_GONE_ERROR, UNKNOWN_SQLSTATE, mysqlnd_server_gone);
|
||||||
|
@ -494,7 +494,7 @@ mysqlnd_connect_run_authentication(
|
||||||
if (FAIL == conn->net->m.enable_ssl(conn->net TSRMLS_CC)) {
|
if (FAIL == conn->net->m.enable_ssl(conn->net TSRMLS_CC)) {
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
auth_packet->send_half_packet = FALSE;
|
auth_packet->send_half_packet = FALSE;
|
||||||
if (!PACKET_WRITE(auth_packet, conn)) {
|
if (!PACKET_WRITE(auth_packet, conn)) {
|
||||||
CONN_SET_STATE(conn, CONN_QUIT_SENT);
|
CONN_SET_STATE(conn, CONN_QUIT_SENT);
|
||||||
|
@ -1196,11 +1196,11 @@ MYSQLND_METHOD(mysqlnd_conn, list_fields)(MYSQLND * conn, const char *table, con
|
||||||
FALSE, TRUE TSRMLS_CC)) {
|
FALSE, TRUE TSRMLS_CC)) {
|
||||||
DBG_RETURN(NULL);
|
DBG_RETURN(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Prepare for the worst case.
|
Prepare for the worst case.
|
||||||
MyISAM goes to 2500 BIT columns, double it for safety.
|
MyISAM goes to 2500 BIT columns, double it for safety.
|
||||||
*/
|
*/
|
||||||
result = conn->m->result_init(5000, conn->persistent TSRMLS_CC);
|
result = conn->m->result_init(5000, conn->persistent TSRMLS_CC);
|
||||||
if (!result) {
|
if (!result) {
|
||||||
DBG_RETURN(NULL);
|
DBG_RETURN(NULL);
|
||||||
|
@ -1960,7 +1960,7 @@ MYSQLND_METHOD(mysqlnd_conn, change_user)(MYSQLND * const conn,
|
||||||
int2store(p, conn->charset->nr);
|
int2store(p, conn->charset->nr);
|
||||||
p+=2;
|
p+=2;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PASS != conn->m->simple_command(conn, COM_CHANGE_USER, buffer, p - buffer,
|
if (PASS != conn->m->simple_command(conn, COM_CHANGE_USER, buffer, p - buffer,
|
||||||
PROT_LAST /* we will handle the OK packet*/,
|
PROT_LAST /* we will handle the OK packet*/,
|
||||||
silent, TRUE TSRMLS_CC)) {
|
silent, TRUE TSRMLS_CC)) {
|
||||||
|
@ -2016,7 +2016,7 @@ MYSQLND_METHOD(mysqlnd_conn, change_user)(MYSQLND * const conn,
|
||||||
} else if (ret == FAIL && chg_user_resp->server_asked_323_auth == TRUE) {
|
} else if (ret == FAIL && chg_user_resp->server_asked_323_auth == TRUE) {
|
||||||
/* old authentication with new server !*/
|
/* old authentication with new server !*/
|
||||||
DBG_ERR(mysqlnd_old_passwd);
|
DBG_ERR(mysqlnd_old_passwd);
|
||||||
SET_CLIENT_ERROR(conn->error_info, CR_UNKNOWN_ERROR, UNKNOWN_SQLSTATE, mysqlnd_old_passwd);
|
SET_CLIENT_ERROR(conn->error_info, CR_UNKNOWN_ERROR, UNKNOWN_SQLSTATE, mysqlnd_old_passwd);
|
||||||
}
|
}
|
||||||
end:
|
end:
|
||||||
PACKET_FREE(chg_user_resp);
|
PACKET_FREE(chg_user_resp);
|
||||||
|
@ -2188,7 +2188,7 @@ MYSQLND_METHOD(mysqlnd_conn, use_result)(MYSQLND * const conn TSRMLS_DC)
|
||||||
conn->current_result->m.free_result(conn->current_result, TRUE TSRMLS_CC);
|
conn->current_result->m.free_result(conn->current_result, TRUE TSRMLS_CC);
|
||||||
}
|
}
|
||||||
conn->current_result = NULL;
|
conn->current_result = NULL;
|
||||||
|
|
||||||
DBG_RETURN(result);
|
DBG_RETURN(result);
|
||||||
}
|
}
|
||||||
/* }}} */
|
/* }}} */
|
||||||
|
@ -2219,7 +2219,7 @@ MYSQLND_METHOD(mysqlnd_conn, store_result)(MYSQLND * const conn TSRMLS_DC)
|
||||||
|
|
||||||
result = conn->current_result->m.store_result(conn->current_result, conn, FALSE TSRMLS_CC);
|
result = conn->current_result->m.store_result(conn->current_result, conn, FALSE TSRMLS_CC);
|
||||||
if (!result) {
|
if (!result) {
|
||||||
conn->current_result->m.free_result(conn->current_result, TRUE TSRMLS_CC);
|
conn->current_result->m.free_result(conn->current_result, TRUE TSRMLS_CC);
|
||||||
}
|
}
|
||||||
conn->current_result = NULL;
|
conn->current_result = NULL;
|
||||||
DBG_RETURN(result);
|
DBG_RETURN(result);
|
||||||
|
|
|
@ -104,7 +104,6 @@ mysqlnd_mempool_resize_chunk(MYSQLND_MEMORY_POOL_CHUNK * chunk, unsigned int siz
|
||||||
DBG_RETURN(FAIL);
|
DBG_RETURN(FAIL);
|
||||||
}
|
}
|
||||||
chunk->ptr = new_ptr;
|
chunk->ptr = new_ptr;
|
||||||
|
|
||||||
}
|
}
|
||||||
DBG_RETURN(PASS);
|
DBG_RETURN(PASS);
|
||||||
}
|
}
|
||||||
|
|
|
@ -399,7 +399,7 @@ static unsigned int check_mb_utf16(const char *start, const char *end)
|
||||||
if (start + 2 > end) {
|
if (start + 2 > end) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (UTF16_HIGH_HEAD(*start)) {
|
if (UTF16_HIGH_HEAD(*start)) {
|
||||||
return (start + 4 <= end) && UTF16_LOW_HEAD(start[2]) ? 4 : 0;
|
return (start + 4 <= end) && UTF16_LOW_HEAD(start[2]) ? 4 : 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -617,7 +617,7 @@ mysqlnd_debug_init(const char * skip_functions[] TSRMLS_DC)
|
||||||
|
|
||||||
ret->m = & mysqlnd_mysqlnd_debug_methods;
|
ret->m = & mysqlnd_mysqlnd_debug_methods;
|
||||||
ret->skip_functions = skip_functions;
|
ret->skip_functions = skip_functions;
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
/* }}} */
|
/* }}} */
|
||||||
|
@ -634,7 +634,7 @@ PHPAPI void _mysqlnd_debug(const char * mode TSRMLS_DC)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dbg->m->close(dbg);
|
dbg->m->close(dbg);
|
||||||
dbg->m->set_mode(dbg, mode);
|
dbg->m->set_mode(dbg, mode);
|
||||||
while (zend_stack_count(&dbg->call_stack)) {
|
while (zend_stack_count(&dbg->call_stack)) {
|
||||||
|
@ -650,7 +650,7 @@ PHPAPI void _mysqlnd_debug(const char * mode TSRMLS_DC)
|
||||||
#define __zend_filename "/unknown/unknown"
|
#define __zend_filename "/unknown/unknown"
|
||||||
#define __zend_lineno 0
|
#define __zend_lineno 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define REAL_SIZE(s) (collect_memory_statistics? (s) + sizeof(size_t) : (s))
|
#define REAL_SIZE(s) (collect_memory_statistics? (s) + sizeof(size_t) : (s))
|
||||||
#define REAL_PTR(p) (collect_memory_statistics && (p)? (((char *)(p)) - sizeof(size_t)) : (p))
|
#define REAL_PTR(p) (collect_memory_statistics && (p)? (((char *)(p)) - sizeof(size_t)) : (p))
|
||||||
#define FAKE_PTR(p) (collect_memory_statistics && (p)? (((char *)(p)) + sizeof(size_t)) : (p))
|
#define FAKE_PTR(p) (collect_memory_statistics && (p)? (((char *)(p)) + sizeof(size_t)) : (p))
|
||||||
|
|
|
@ -57,7 +57,7 @@ int mysqlnd_local_infile_init(void **ptr, char *filename, void **userdata TSRMLS
|
||||||
if (!info) {
|
if (!info) {
|
||||||
DBG_RETURN(1);
|
DBG_RETURN(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
*ptr = info;
|
*ptr = info;
|
||||||
|
|
||||||
/* check open_basedir */
|
/* check open_basedir */
|
||||||
|
|
|
@ -175,7 +175,7 @@ MYSQLND_METHOD(mysqlnd_stmt, get_result)(MYSQLND_STMT * const s TSRMLS_DC)
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((result = result->m.store_result(result, conn, TRUE TSRMLS_CC))) {
|
if ((result = result->m.store_result(result, conn, TRUE TSRMLS_CC))) {
|
||||||
stmt->upsert_status.affected_rows = result->stored_data->row_count;
|
stmt->upsert_status.affected_rows = result->stored_data->row_count;
|
||||||
stmt->state = MYSQLND_STMT_PREPARED;
|
stmt->state = MYSQLND_STMT_PREPARED;
|
||||||
result->type = MYSQLND_RES_PS_BUF;
|
result->type = MYSQLND_RES_PS_BUF;
|
||||||
} else {
|
} else {
|
||||||
|
@ -290,7 +290,7 @@ mysqlnd_stmt_read_prepare_response(MYSQLND_STMT * s TSRMLS_DC)
|
||||||
if (!prepare_resp) {
|
if (!prepare_resp) {
|
||||||
SET_OOM_ERROR(stmt->error_info);
|
SET_OOM_ERROR(stmt->error_info);
|
||||||
SET_OOM_ERROR(stmt->conn->error_info);
|
SET_OOM_ERROR(stmt->conn->error_info);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (FAIL == PACKET_READ(prepare_resp, stmt->conn)) {
|
if (FAIL == PACKET_READ(prepare_resp, stmt->conn)) {
|
||||||
|
@ -579,7 +579,7 @@ MYSQLND_METHOD(mysqlnd_stmt, execute)(MYSQLND_STMT * const s TSRMLS_DC)
|
||||||
|
|
||||||
SET_ERROR_AFF_ROWS(stmt);
|
SET_ERROR_AFF_ROWS(stmt);
|
||||||
SET_ERROR_AFF_ROWS(stmt->conn);
|
SET_ERROR_AFF_ROWS(stmt->conn);
|
||||||
|
|
||||||
if (stmt->result && stmt->state >= MYSQLND_STMT_PREPARED && stmt->field_count) {
|
if (stmt->result && stmt->state >= MYSQLND_STMT_PREPARED && stmt->field_count) {
|
||||||
/*
|
/*
|
||||||
We don need to copy the data from the buffers which we will clean.
|
We don need to copy the data from the buffers which we will clean.
|
||||||
|
@ -911,7 +911,7 @@ mysqlnd_stmt_fetch_row_unbuffered(MYSQLND_RES *result, void *param, unsigned int
|
||||||
stmt->error_info = row_packet->error_info;
|
stmt->error_info = row_packet->error_info;
|
||||||
}
|
}
|
||||||
CONN_SET_STATE(result->conn, CONN_READY);
|
CONN_SET_STATE(result->conn, CONN_READY);
|
||||||
result->unbuf->eof_reached = TRUE; /* so next time we won't get an error */
|
result->unbuf->eof_reached = TRUE; /* so next time we won't get an error */
|
||||||
} else if (row_packet->eof) {
|
} else if (row_packet->eof) {
|
||||||
DBG_INF("EOF");
|
DBG_INF("EOF");
|
||||||
/* Mark the connection as usable again */
|
/* Mark the connection as usable again */
|
||||||
|
@ -1265,7 +1265,7 @@ MYSQLND_METHOD(mysqlnd_stmt, send_long_data)(MYSQLND_STMT * const s, unsigned in
|
||||||
MYSQLND * conn;
|
MYSQLND * conn;
|
||||||
zend_uchar *cmd_buf;
|
zend_uchar *cmd_buf;
|
||||||
enum php_mysqlnd_server_command cmd = COM_STMT_SEND_LONG_DATA;
|
enum php_mysqlnd_server_command cmd = COM_STMT_SEND_LONG_DATA;
|
||||||
|
|
||||||
DBG_ENTER("mysqlnd_stmt::send_long_data");
|
DBG_ENTER("mysqlnd_stmt::send_long_data");
|
||||||
if (!stmt || !stmt->conn) {
|
if (!stmt || !stmt->conn) {
|
||||||
DBG_RETURN(FAIL);
|
DBG_RETURN(FAIL);
|
||||||
|
@ -1320,16 +1320,15 @@ MYSQLND_METHOD(mysqlnd_stmt, send_long_data)(MYSQLND_STMT * const s, unsigned in
|
||||||
memcpy(cmd_buf + STMT_ID_LENGTH + 2, data, length);
|
memcpy(cmd_buf + STMT_ID_LENGTH + 2, data, length);
|
||||||
|
|
||||||
/* COM_STMT_SEND_LONG_DATA doesn't send an OK packet*/
|
/* COM_STMT_SEND_LONG_DATA doesn't send an OK packet*/
|
||||||
ret = conn->m->simple_command(conn, cmd, (char *)cmd_buf, packet_len,
|
ret = conn->m->simple_command(conn, cmd, (char *)cmd_buf, packet_len, PROT_LAST , FALSE, TRUE TSRMLS_CC);
|
||||||
PROT_LAST , FALSE, TRUE TSRMLS_CC);
|
|
||||||
mnd_efree(cmd_buf);
|
mnd_efree(cmd_buf);
|
||||||
if (FAIL == ret) {
|
if (FAIL == ret) {
|
||||||
stmt->error_info = conn->error_info;
|
stmt->error_info = conn->error_info;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ret = FAIL;
|
ret = FAIL;
|
||||||
SET_OOM_ERROR(stmt->error_info);
|
SET_OOM_ERROR(stmt->error_info);
|
||||||
SET_OOM_ERROR(conn->error_info);
|
SET_OOM_ERROR(conn->error_info);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
Cover protocol error: COM_STMT_SEND_LONG_DATA was designed to be quick and not
|
Cover protocol error: COM_STMT_SEND_LONG_DATA was designed to be quick and not
|
||||||
|
@ -1474,7 +1473,7 @@ MYSQLND_METHOD(mysqlnd_stmt, bind_one_parameter)(MYSQLND_STMT * const s, unsigne
|
||||||
DBG_RETURN(FAIL);
|
DBG_RETURN(FAIL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Prevent from freeing */
|
/* Prevent from freeing */
|
||||||
/* Don't update is_ref, or we will leak during conversion */
|
/* Don't update is_ref, or we will leak during conversion */
|
||||||
Z_ADDREF_P(zv);
|
Z_ADDREF_P(zv);
|
||||||
|
@ -1489,7 +1488,7 @@ MYSQLND_METHOD(mysqlnd_stmt, bind_one_parameter)(MYSQLND_STMT * const s, unsigne
|
||||||
}
|
}
|
||||||
stmt->param_bind[param_no].zv = zv;
|
stmt->param_bind[param_no].zv = zv;
|
||||||
stmt->param_bind[param_no].type = type;
|
stmt->param_bind[param_no].type = type;
|
||||||
|
|
||||||
stmt->send_types_to_server = 1;
|
stmt->send_types_to_server = 1;
|
||||||
}
|
}
|
||||||
DBG_INF("PASS");
|
DBG_INF("PASS");
|
||||||
|
@ -1812,7 +1811,7 @@ MYSQLND_METHOD(mysqlnd_stmt, result_metadata)(MYSQLND_STMT * const s TSRMLS_DC)
|
||||||
if (result) {
|
if (result) {
|
||||||
result->m.free_result(result, TRUE TSRMLS_CC);
|
result->m.free_result(result, TRUE TSRMLS_CC);
|
||||||
}
|
}
|
||||||
DBG_RETURN(NULL);
|
DBG_RETURN(NULL);
|
||||||
}
|
}
|
||||||
/* }}} */
|
/* }}} */
|
||||||
|
|
||||||
|
@ -2367,7 +2366,7 @@ MYSQLND_STMT * _mysqlnd_stmt_init(MYSQLND * const conn TSRMLS_DC)
|
||||||
|
|
||||||
DBG_RETURN(ret);
|
DBG_RETURN(ret);
|
||||||
} while (0);
|
} while (0);
|
||||||
|
|
||||||
SET_OOM_ERROR(conn->error_info);
|
SET_OOM_ERROR(conn->error_info);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
ret->m->dtor(ret, TRUE TSRMLS_CC);
|
ret->m->dtor(ret, TRUE TSRMLS_CC);
|
||||||
|
|
|
@ -482,7 +482,7 @@ void _mysqlnd_init_ps_fetch_subsystem()
|
||||||
mysqlnd_ps_fetch_functions[MYSQL_TYPE_DOUBLE].pack_len = 8;
|
mysqlnd_ps_fetch_functions[MYSQL_TYPE_DOUBLE].pack_len = 8;
|
||||||
mysqlnd_ps_fetch_functions[MYSQL_TYPE_DOUBLE].php_type = IS_DOUBLE;
|
mysqlnd_ps_fetch_functions[MYSQL_TYPE_DOUBLE].php_type = IS_DOUBLE;
|
||||||
mysqlnd_ps_fetch_functions[MYSQL_TYPE_DOUBLE].can_ret_as_str_in_uni = TRUE;
|
mysqlnd_ps_fetch_functions[MYSQL_TYPE_DOUBLE].can_ret_as_str_in_uni = TRUE;
|
||||||
|
|
||||||
mysqlnd_ps_fetch_functions[MYSQL_TYPE_TIME].func = ps_fetch_time;
|
mysqlnd_ps_fetch_functions[MYSQL_TYPE_TIME].func = ps_fetch_time;
|
||||||
mysqlnd_ps_fetch_functions[MYSQL_TYPE_TIME].pack_len = MYSQLND_PS_SKIP_RESULT_W_LEN;
|
mysqlnd_ps_fetch_functions[MYSQL_TYPE_TIME].pack_len = MYSQLND_PS_SKIP_RESULT_W_LEN;
|
||||||
mysqlnd_ps_fetch_functions[MYSQL_TYPE_TIME].php_type = IS_STRING;
|
mysqlnd_ps_fetch_functions[MYSQL_TYPE_TIME].php_type = IS_STRING;
|
||||||
|
@ -497,7 +497,7 @@ void _mysqlnd_init_ps_fetch_subsystem()
|
||||||
mysqlnd_ps_fetch_functions[MYSQL_TYPE_NEWDATE].pack_len = MYSQLND_PS_SKIP_RESULT_W_LEN;
|
mysqlnd_ps_fetch_functions[MYSQL_TYPE_NEWDATE].pack_len = MYSQLND_PS_SKIP_RESULT_W_LEN;
|
||||||
mysqlnd_ps_fetch_functions[MYSQL_TYPE_NEWDATE].php_type = IS_STRING;
|
mysqlnd_ps_fetch_functions[MYSQL_TYPE_NEWDATE].php_type = IS_STRING;
|
||||||
mysqlnd_ps_fetch_functions[MYSQL_TYPE_NEWDATE].can_ret_as_str_in_uni = TRUE;
|
mysqlnd_ps_fetch_functions[MYSQL_TYPE_NEWDATE].can_ret_as_str_in_uni = TRUE;
|
||||||
|
|
||||||
mysqlnd_ps_fetch_functions[MYSQL_TYPE_DATETIME].func = ps_fetch_datetime;
|
mysqlnd_ps_fetch_functions[MYSQL_TYPE_DATETIME].func = ps_fetch_datetime;
|
||||||
mysqlnd_ps_fetch_functions[MYSQL_TYPE_DATETIME].pack_len= MYSQLND_PS_SKIP_RESULT_W_LEN;
|
mysqlnd_ps_fetch_functions[MYSQL_TYPE_DATETIME].pack_len= MYSQLND_PS_SKIP_RESULT_W_LEN;
|
||||||
mysqlnd_ps_fetch_functions[MYSQL_TYPE_DATETIME].php_type= IS_STRING;
|
mysqlnd_ps_fetch_functions[MYSQL_TYPE_DATETIME].php_type= IS_STRING;
|
||||||
|
@ -507,7 +507,7 @@ void _mysqlnd_init_ps_fetch_subsystem()
|
||||||
mysqlnd_ps_fetch_functions[MYSQL_TYPE_TIMESTAMP].pack_len= MYSQLND_PS_SKIP_RESULT_W_LEN;
|
mysqlnd_ps_fetch_functions[MYSQL_TYPE_TIMESTAMP].pack_len= MYSQLND_PS_SKIP_RESULT_W_LEN;
|
||||||
mysqlnd_ps_fetch_functions[MYSQL_TYPE_TIMESTAMP].php_type= IS_STRING;
|
mysqlnd_ps_fetch_functions[MYSQL_TYPE_TIMESTAMP].php_type= IS_STRING;
|
||||||
mysqlnd_ps_fetch_functions[MYSQL_TYPE_TIMESTAMP].can_ret_as_str_in_uni = TRUE;
|
mysqlnd_ps_fetch_functions[MYSQL_TYPE_TIMESTAMP].can_ret_as_str_in_uni = TRUE;
|
||||||
|
|
||||||
mysqlnd_ps_fetch_functions[MYSQL_TYPE_TINY_BLOB].func = ps_fetch_string;
|
mysqlnd_ps_fetch_functions[MYSQL_TYPE_TINY_BLOB].func = ps_fetch_string;
|
||||||
mysqlnd_ps_fetch_functions[MYSQL_TYPE_TINY_BLOB].pack_len= MYSQLND_PS_SKIP_RESULT_STR;
|
mysqlnd_ps_fetch_functions[MYSQL_TYPE_TINY_BLOB].pack_len= MYSQLND_PS_SKIP_RESULT_STR;
|
||||||
mysqlnd_ps_fetch_functions[MYSQL_TYPE_TINY_BLOB].php_type = IS_STRING;
|
mysqlnd_ps_fetch_functions[MYSQL_TYPE_TINY_BLOB].php_type = IS_STRING;
|
||||||
|
@ -519,7 +519,7 @@ void _mysqlnd_init_ps_fetch_subsystem()
|
||||||
mysqlnd_ps_fetch_functions[MYSQL_TYPE_BLOB].php_type = IS_STRING;
|
mysqlnd_ps_fetch_functions[MYSQL_TYPE_BLOB].php_type = IS_STRING;
|
||||||
mysqlnd_ps_fetch_functions[MYSQL_TYPE_BLOB].is_possibly_blob = TRUE;
|
mysqlnd_ps_fetch_functions[MYSQL_TYPE_BLOB].is_possibly_blob = TRUE;
|
||||||
mysqlnd_ps_fetch_functions[MYSQL_TYPE_BLOB].can_ret_as_str_in_uni = TRUE;
|
mysqlnd_ps_fetch_functions[MYSQL_TYPE_BLOB].can_ret_as_str_in_uni = TRUE;
|
||||||
|
|
||||||
mysqlnd_ps_fetch_functions[MYSQL_TYPE_MEDIUM_BLOB].func = ps_fetch_string;
|
mysqlnd_ps_fetch_functions[MYSQL_TYPE_MEDIUM_BLOB].func = ps_fetch_string;
|
||||||
mysqlnd_ps_fetch_functions[MYSQL_TYPE_MEDIUM_BLOB].pack_len = MYSQLND_PS_SKIP_RESULT_STR;
|
mysqlnd_ps_fetch_functions[MYSQL_TYPE_MEDIUM_BLOB].pack_len = MYSQLND_PS_SKIP_RESULT_STR;
|
||||||
mysqlnd_ps_fetch_functions[MYSQL_TYPE_MEDIUM_BLOB].php_type = IS_STRING;
|
mysqlnd_ps_fetch_functions[MYSQL_TYPE_MEDIUM_BLOB].php_type = IS_STRING;
|
||||||
|
@ -619,7 +619,6 @@ mysqlnd_stmt_execute_store_params(MYSQLND_STMT * s, zend_uchar **buf, zend_uchar
|
||||||
time we try to send > LONG_MAX, the conversion to string will send a string and the server
|
time we try to send > LONG_MAX, the conversion to string will send a string and the server
|
||||||
won't expect it and interpret the value as 0. Thus we need to resend the types, if any such values
|
won't expect it and interpret the value as 0. Thus we need to resend the types, if any such values
|
||||||
occur, and force resend for the next execution.
|
occur, and force resend for the next execution.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
for (i = 0; i < stmt->param_count; i++) {
|
for (i = 0; i < stmt->param_count; i++) {
|
||||||
if (Z_TYPE_P(stmt->param_bind[i].zv) != IS_NULL &&
|
if (Z_TYPE_P(stmt->param_bind[i].zv) != IS_NULL &&
|
||||||
|
@ -662,7 +661,7 @@ mysqlnd_stmt_execute_store_params(MYSQLND_STMT * s, zend_uchar **buf, zend_uchar
|
||||||
}
|
}
|
||||||
memcpy(tmp_buf, *buf, offset);
|
memcpy(tmp_buf, *buf, offset);
|
||||||
*buf = tmp_buf;
|
*buf = tmp_buf;
|
||||||
|
|
||||||
/* Update our pos pointer */
|
/* Update our pos pointer */
|
||||||
*p = *buf + offset;
|
*p = *buf + offset;
|
||||||
}
|
}
|
||||||
|
@ -741,7 +740,7 @@ mysqlnd_stmt_execute_store_params(MYSQLND_STMT * s, zend_uchar **buf, zend_uchar
|
||||||
{
|
{
|
||||||
zval *tmp_data = (copies && copies[i])? copies[i]: stmt->param_bind[i].zv;
|
zval *tmp_data = (copies && copies[i])? copies[i]: stmt->param_bind[i].zv;
|
||||||
if (Z_TYPE_P(tmp_data) == IS_STRING) {
|
if (Z_TYPE_P(tmp_data) == IS_STRING) {
|
||||||
goto use_string;
|
goto use_string;
|
||||||
}
|
}
|
||||||
convert_to_long_ex(&tmp_data);
|
convert_to_long_ex(&tmp_data);
|
||||||
}
|
}
|
||||||
|
@ -751,7 +750,7 @@ mysqlnd_stmt_execute_store_params(MYSQLND_STMT * s, zend_uchar **buf, zend_uchar
|
||||||
{
|
{
|
||||||
zval *tmp_data = (copies && copies[i])? copies[i]: stmt->param_bind[i].zv;
|
zval *tmp_data = (copies && copies[i])? copies[i]: stmt->param_bind[i].zv;
|
||||||
if (Z_TYPE_P(tmp_data) == IS_STRING) {
|
if (Z_TYPE_P(tmp_data) == IS_STRING) {
|
||||||
goto use_string;
|
goto use_string;
|
||||||
}
|
}
|
||||||
convert_to_long_ex(&tmp_data);
|
convert_to_long_ex(&tmp_data);
|
||||||
}
|
}
|
||||||
|
@ -793,7 +792,6 @@ use_string:
|
||||||
data_size += Z_STRLEN_P(the_var);
|
data_size += Z_STRLEN_P(the_var);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 2.2 Enlarge the buffer, if needed */
|
/* 2.2 Enlarge the buffer, if needed */
|
||||||
|
|
|
@ -172,7 +172,6 @@ MYSQLND_METHOD(mysqlnd_res, unbuffered_free_last_data)(MYSQLND_RES * result TSRM
|
||||||
ctor_called_count,
|
ctor_called_count,
|
||||||
STAT_COPY_ON_WRITE_SAVED,
|
STAT_COPY_ON_WRITE_SAVED,
|
||||||
result->field_count - ctor_called_count);
|
result->field_count - ctor_called_count);
|
||||||
|
|
||||||
/* Free last row's zvals */
|
/* Free last row's zvals */
|
||||||
mnd_efree(unbuf->last_row_data);
|
mnd_efree(unbuf->last_row_data);
|
||||||
unbuf->last_row_data = NULL;
|
unbuf->last_row_data = NULL;
|
||||||
|
@ -506,7 +505,7 @@ mysqlnd_query_read_result_set_header(MYSQLND *conn, MYSQLND_STMT * s TSRMLS_DC)
|
||||||
ret = FAIL;
|
ret = FAIL;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (FAIL == (ret = result->m.read_result_metadata(result, conn TSRMLS_CC))) {
|
if (FAIL == (ret = result->m.read_result_metadata(result, conn TSRMLS_CC))) {
|
||||||
/* For PS, we leave them in Prepared state */
|
/* For PS, we leave them in Prepared state */
|
||||||
if (!stmt && conn->current_result) {
|
if (!stmt && conn->current_result) {
|
||||||
|
@ -1166,7 +1165,7 @@ MYSQLND_METHOD(mysqlnd_res, store_result_fetch_data)(MYSQLND * const conn, MYSQL
|
||||||
if (!row_packet) {
|
if (!row_packet) {
|
||||||
SET_OOM_ERROR(conn->error_info);
|
SET_OOM_ERROR(conn->error_info);
|
||||||
ret = FAIL;
|
ret = FAIL;
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
row_packet->result_set_memory_pool = result->result_set_memory_pool;
|
row_packet->result_set_memory_pool = result->result_set_memory_pool;
|
||||||
row_packet->field_count = meta->field_count;
|
row_packet->field_count = meta->field_count;
|
||||||
|
@ -1639,7 +1638,7 @@ MYSQLND_METHOD(mysqlnd_res, fetch_field_data)(MYSQLND_RES * result, unsigned int
|
||||||
zend_hash_move_forward(Z_ARRVAL(row));
|
zend_hash_move_forward(Z_ARRVAL(row));
|
||||||
zend_hash_get_current_data(Z_ARRVAL(row), (void **)&entry);
|
zend_hash_get_current_data(Z_ARRVAL(row), (void **)&entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
zend_hash_get_current_data(Z_ARRVAL(row), (void **)&entry);
|
zend_hash_get_current_data(Z_ARRVAL(row), (void **)&entry);
|
||||||
|
|
||||||
*return_value = **entry;
|
*return_value = **entry;
|
||||||
|
@ -1698,7 +1697,7 @@ mysqlnd_result_init(unsigned int field_count, zend_bool persistent TSRMLS_DC)
|
||||||
|
|
||||||
DBG_ENTER("mysqlnd_result_init");
|
DBG_ENTER("mysqlnd_result_init");
|
||||||
DBG_INF_FMT("field_count=%u", field_count);
|
DBG_INF_FMT("field_count=%u", field_count);
|
||||||
|
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
DBG_RETURN(NULL);
|
DBG_RETURN(NULL);
|
||||||
}
|
}
|
||||||
|
|
|
@ -175,7 +175,7 @@ MYSQLND_METHOD(mysqlnd_res_meta, read_metadata)(MYSQLND_RES_METADATA * const met
|
||||||
PACKET_FREE(field_packet);
|
PACKET_FREE(field_packet);
|
||||||
DBG_RETURN(FAIL);
|
DBG_RETURN(FAIL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (field_packet->stupid_list_fields_eof == TRUE) {
|
if (field_packet->stupid_list_fields_eof == TRUE) {
|
||||||
meta->field_count = i;
|
meta->field_count = i;
|
||||||
break;
|
break;
|
||||||
|
@ -224,7 +224,6 @@ MYSQLND_METHOD(mysqlnd_res_meta, read_metadata)(MYSQLND_RES_METADATA * const met
|
||||||
meta->bit_fields_total_len += 3;/* 120 */
|
meta->bit_fields_total_len += 3;/* 120 */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if MYSQLND_UNICODE
|
#if MYSQLND_UNICODE
|
||||||
|
@ -475,7 +474,7 @@ mysqlnd_result_meta_init(unsigned int field_count, zend_bool persistent TSRMLS_D
|
||||||
MYSQLND_RES_METADATA *ret = mnd_pecalloc(1, alloc_size, persistent);
|
MYSQLND_RES_METADATA *ret = mnd_pecalloc(1, alloc_size, persistent);
|
||||||
DBG_ENTER("mysqlnd_result_meta_init");
|
DBG_ENTER("mysqlnd_result_meta_init");
|
||||||
DBG_INF_FMT("persistent=%u", persistent);
|
DBG_INF_FMT("persistent=%u", persistent);
|
||||||
|
|
||||||
do {
|
do {
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -208,7 +208,7 @@ mysqlnd_fill_stats_hash(const MYSQLND_STATS * const stats, const MYSQLND_STRING
|
||||||
int ulen, tlen;
|
int ulen, tlen;
|
||||||
#endif
|
#endif
|
||||||
char tmp[25];
|
char tmp[25];
|
||||||
|
|
||||||
sprintf((char *)&tmp, MYSQLND_LLU_SPEC, stats->values[i]);
|
sprintf((char *)&tmp, MYSQLND_LLU_SPEC, stats->values[i]);
|
||||||
#if MYSQLND_UNICODE
|
#if MYSQLND_UNICODE
|
||||||
zend_string_to_unicode(UG(utf8_conv), &ustr, &ulen, names[i].s, names[i].l + 1 TSRMLS_CC);
|
zend_string_to_unicode(UG(utf8_conv), &ustr, &ulen, names[i].s, names[i].l + 1 TSRMLS_CC);
|
||||||
|
|
|
@ -64,7 +64,7 @@ extern const MYSQLND_STRING mysqlnd_stats_values_names[];
|
||||||
MYSQLND_STAT_CALL_TRIGGER((stats), (statistic), (value)); \
|
MYSQLND_STAT_CALL_TRIGGER((stats), (statistic), (value)); \
|
||||||
MYSQLND_STATS_UNLOCK(_p_s); \
|
MYSQLND_STATS_UNLOCK(_p_s); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define MYSQLND_DEC_STATISTIC(enabler, stats, statistic) \
|
#define MYSQLND_DEC_STATISTIC(enabler, stats, statistic) \
|
||||||
{ \
|
{ \
|
||||||
enum_mysqlnd_collected_stats _s = (statistic);\
|
enum_mysqlnd_collected_stats _s = (statistic);\
|
||||||
|
|
|
@ -1220,10 +1220,10 @@ php_mysqlnd_rowp_read_binary_protocol(MYSQLND_MEMORY_POOL_CHUNK * row_buffer, zv
|
||||||
DBG_RETURN(FAIL);
|
DBG_RETURN(FAIL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0, current_field = start_field; current_field < end_field; current_field++, i++) {
|
for (i = 0, current_field = start_field; current_field < end_field; current_field++, i++) {
|
||||||
enum_mysqlnd_collected_stats statistic;
|
enum_mysqlnd_collected_stats statistic;
|
||||||
|
|
||||||
DBG_INF_FMT("Into zval=%p decoding column %u [%s.%s.%s] type=%u field->flags&unsigned=%u flags=%u is_bit=%u as_unicode=%u",
|
DBG_INF_FMT("Into zval=%p decoding column %u [%s.%s.%s] type=%u field->flags&unsigned=%u flags=%u is_bit=%u as_unicode=%u",
|
||||||
*current_field, i,
|
*current_field, i,
|
||||||
fields_metadata[i].db, fields_metadata[i].table, fields_metadata[i].name, fields_metadata[i].type,
|
fields_metadata[i].db, fields_metadata[i].table, fields_metadata[i].name, fields_metadata[i].type,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue