Skip to content

Commit 859a140

Browse files
committed
WS fixes
1 parent 1ab3856 commit 859a140

12 files changed

+43
-49
lines changed

ext/mysqlnd/mysqlnd.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ MYSQLND_METHOD(mysqlnd_conn, simple_command_handle_response)(MYSQLND * conn, enu
280280
MYSQLND_PACKET_EOF * ok_response = conn->protocol->m.get_eof_packet(conn->protocol, FALSE TSRMLS_CC);
281281
if (!ok_response) {
282282
SET_OOM_ERROR(conn->error_info);
283-
break;
283+
break;
284284
}
285285
if (FAIL == (ret = PACKET_READ(ok_response, conn))) {
286286
SET_CLIENT_ERROR(conn->error_info, CR_MALFORMED_PACKET, UNKNOWN_SQLSTATE,
@@ -477,7 +477,7 @@ mysqlnd_connect_run_authentication(
477477
goto err;
478478
}
479479
memcpy(auth_packet->server_scramble_buf, greet_packet->scramble_buf, SCRAMBLE_LENGTH);
480-
480+
481481
if (!PACKET_WRITE(auth_packet, conn)) {
482482
CONN_SET_STATE(conn, CONN_QUIT_SENT);
483483
SET_CLIENT_ERROR(conn->error_info, CR_SERVER_GONE_ERROR, UNKNOWN_SQLSTATE, mysqlnd_server_gone);
@@ -494,7 +494,7 @@ mysqlnd_connect_run_authentication(
494494
if (FAIL == conn->net->m.enable_ssl(conn->net TSRMLS_CC)) {
495495
goto err;
496496
}
497-
497+
498498
auth_packet->send_half_packet = FALSE;
499499
if (!PACKET_WRITE(auth_packet, conn)) {
500500
CONN_SET_STATE(conn, CONN_QUIT_SENT);
@@ -1196,11 +1196,11 @@ MYSQLND_METHOD(mysqlnd_conn, list_fields)(MYSQLND * conn, const char *table, con
11961196
FALSE, TRUE TSRMLS_CC)) {
11971197
DBG_RETURN(NULL);
11981198
}
1199-
1199+
12001200
/*
12011201
Prepare for the worst case.
12021202
MyISAM goes to 2500 BIT columns, double it for safety.
1203-
*/
1203+
*/
12041204
result = conn->m->result_init(5000, conn->persistent TSRMLS_CC);
12051205
if (!result) {
12061206
DBG_RETURN(NULL);
@@ -1960,7 +1960,7 @@ MYSQLND_METHOD(mysqlnd_conn, change_user)(MYSQLND * const conn,
19601960
int2store(p, conn->charset->nr);
19611961
p+=2;
19621962
}
1963-
1963+
19641964
if (PASS != conn->m->simple_command(conn, COM_CHANGE_USER, buffer, p - buffer,
19651965
PROT_LAST /* we will handle the OK packet*/,
19661966
silent, TRUE TSRMLS_CC)) {
@@ -2016,7 +2016,7 @@ MYSQLND_METHOD(mysqlnd_conn, change_user)(MYSQLND * const conn,
20162016
} else if (ret == FAIL && chg_user_resp->server_asked_323_auth == TRUE) {
20172017
/* old authentication with new server !*/
20182018
DBG_ERR(mysqlnd_old_passwd);
2019-
SET_CLIENT_ERROR(conn->error_info, CR_UNKNOWN_ERROR, UNKNOWN_SQLSTATE, mysqlnd_old_passwd);
2019+
SET_CLIENT_ERROR(conn->error_info, CR_UNKNOWN_ERROR, UNKNOWN_SQLSTATE, mysqlnd_old_passwd);
20202020
}
20212021
end:
20222022
PACKET_FREE(chg_user_resp);
@@ -2188,7 +2188,7 @@ MYSQLND_METHOD(mysqlnd_conn, use_result)(MYSQLND * const conn TSRMLS_DC)
21882188
conn->current_result->m.free_result(conn->current_result, TRUE TSRMLS_CC);
21892189
}
21902190
conn->current_result = NULL;
2191-
2191+
21922192
DBG_RETURN(result);
21932193
}
21942194
/* }}} */
@@ -2219,7 +2219,7 @@ MYSQLND_METHOD(mysqlnd_conn, store_result)(MYSQLND * const conn TSRMLS_DC)
22192219

22202220
result = conn->current_result->m.store_result(conn->current_result, conn, FALSE TSRMLS_CC);
22212221
if (!result) {
2222-
conn->current_result->m.free_result(conn->current_result, TRUE TSRMLS_CC);
2222+
conn->current_result->m.free_result(conn->current_result, TRUE TSRMLS_CC);
22232223
}
22242224
conn->current_result = NULL;
22252225
DBG_RETURN(result);

ext/mysqlnd/mysqlnd_block_alloc.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ mysqlnd_mempool_resize_chunk(MYSQLND_MEMORY_POOL_CHUNK * chunk, unsigned int siz
104104
DBG_RETURN(FAIL);
105105
}
106106
chunk->ptr = new_ptr;
107-
108107
}
109108
DBG_RETURN(PASS);
110109
}

ext/mysqlnd/mysqlnd_charset.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ static unsigned int check_mb_utf16(const char *start, const char *end)
399399
if (start + 2 > end) {
400400
return 0;
401401
}
402-
402+
403403
if (UTF16_HIGH_HEAD(*start)) {
404404
return (start + 4 <= end) && UTF16_LOW_HEAD(start[2]) ? 4 : 0;
405405
}

ext/mysqlnd/mysqlnd_debug.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ mysqlnd_debug_init(const char * skip_functions[] TSRMLS_DC)
617617

618618
ret->m = & mysqlnd_mysqlnd_debug_methods;
619619
ret->skip_functions = skip_functions;
620-
620+
621621
return ret;
622622
}
623623
/* }}} */
@@ -634,7 +634,7 @@ PHPAPI void _mysqlnd_debug(const char * mode TSRMLS_DC)
634634
return;
635635
}
636636
}
637-
637+
638638
dbg->m->close(dbg);
639639
dbg->m->set_mode(dbg, mode);
640640
while (zend_stack_count(&dbg->call_stack)) {
@@ -650,7 +650,7 @@ PHPAPI void _mysqlnd_debug(const char * mode TSRMLS_DC)
650650
#define __zend_filename "/unknown/unknown"
651651
#define __zend_lineno 0
652652
#endif
653-
653+
654654
#define REAL_SIZE(s) (collect_memory_statistics? (s) + sizeof(size_t) : (s))
655655
#define REAL_PTR(p) (collect_memory_statistics && (p)? (((char *)(p)) - sizeof(size_t)) : (p))
656656
#define FAKE_PTR(p) (collect_memory_statistics && (p)? (((char *)(p)) + sizeof(size_t)) : (p))

ext/mysqlnd/mysqlnd_loaddata.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ int mysqlnd_local_infile_init(void **ptr, char *filename, void **userdata TSRMLS
5757
if (!info) {
5858
DBG_RETURN(1);
5959
}
60-
60+
6161
*ptr = info;
6262

6363
/* check open_basedir */

ext/mysqlnd/mysqlnd_ps.c

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ MYSQLND_METHOD(mysqlnd_stmt, get_result)(MYSQLND_STMT * const s TSRMLS_DC)
175175
}
176176

177177
if ((result = result->m.store_result(result, conn, TRUE TSRMLS_CC))) {
178-
stmt->upsert_status.affected_rows = result->stored_data->row_count;
178+
stmt->upsert_status.affected_rows = result->stored_data->row_count;
179179
stmt->state = MYSQLND_STMT_PREPARED;
180180
result->type = MYSQLND_RES_PS_BUF;
181181
} else {
@@ -290,7 +290,7 @@ mysqlnd_stmt_read_prepare_response(MYSQLND_STMT * s TSRMLS_DC)
290290
if (!prepare_resp) {
291291
SET_OOM_ERROR(stmt->error_info);
292292
SET_OOM_ERROR(stmt->conn->error_info);
293-
goto done;
293+
goto done;
294294
}
295295

296296
if (FAIL == PACKET_READ(prepare_resp, stmt->conn)) {
@@ -579,7 +579,7 @@ MYSQLND_METHOD(mysqlnd_stmt, execute)(MYSQLND_STMT * const s TSRMLS_DC)
579579

580580
SET_ERROR_AFF_ROWS(stmt);
581581
SET_ERROR_AFF_ROWS(stmt->conn);
582-
582+
583583
if (stmt->result && stmt->state >= MYSQLND_STMT_PREPARED && stmt->field_count) {
584584
/*
585585
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
911911
stmt->error_info = row_packet->error_info;
912912
}
913913
CONN_SET_STATE(result->conn, CONN_READY);
914-
result->unbuf->eof_reached = TRUE; /* so next time we won't get an error */
914+
result->unbuf->eof_reached = TRUE; /* so next time we won't get an error */
915915
} else if (row_packet->eof) {
916916
DBG_INF("EOF");
917917
/* Mark the connection as usable again */
@@ -1265,7 +1265,7 @@ MYSQLND_METHOD(mysqlnd_stmt, send_long_data)(MYSQLND_STMT * const s, unsigned in
12651265
MYSQLND * conn;
12661266
zend_uchar *cmd_buf;
12671267
enum php_mysqlnd_server_command cmd = COM_STMT_SEND_LONG_DATA;
1268-
1268+
12691269
DBG_ENTER("mysqlnd_stmt::send_long_data");
12701270
if (!stmt || !stmt->conn) {
12711271
DBG_RETURN(FAIL);
@@ -1320,16 +1320,15 @@ MYSQLND_METHOD(mysqlnd_stmt, send_long_data)(MYSQLND_STMT * const s, unsigned in
13201320
memcpy(cmd_buf + STMT_ID_LENGTH + 2, data, length);
13211321

13221322
/* COM_STMT_SEND_LONG_DATA doesn't send an OK packet*/
1323-
ret = conn->m->simple_command(conn, cmd, (char *)cmd_buf, packet_len,
1324-
PROT_LAST , FALSE, TRUE TSRMLS_CC);
1323+
ret = conn->m->simple_command(conn, cmd, (char *)cmd_buf, packet_len, PROT_LAST , FALSE, TRUE TSRMLS_CC);
13251324
mnd_efree(cmd_buf);
13261325
if (FAIL == ret) {
13271326
stmt->error_info = conn->error_info;
13281327
}
13291328
} else {
13301329
ret = FAIL;
1331-
SET_OOM_ERROR(stmt->error_info);
1332-
SET_OOM_ERROR(conn->error_info);
1330+
SET_OOM_ERROR(stmt->error_info);
1331+
SET_OOM_ERROR(conn->error_info);
13331332
}
13341333
/*
13351334
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
14741473
DBG_RETURN(FAIL);
14751474
}
14761475
}
1477-
1476+
14781477
/* Prevent from freeing */
14791478
/* Don't update is_ref, or we will leak during conversion */
14801479
Z_ADDREF_P(zv);
@@ -1489,7 +1488,7 @@ MYSQLND_METHOD(mysqlnd_stmt, bind_one_parameter)(MYSQLND_STMT * const s, unsigne
14891488
}
14901489
stmt->param_bind[param_no].zv = zv;
14911490
stmt->param_bind[param_no].type = type;
1492-
1491+
14931492
stmt->send_types_to_server = 1;
14941493
}
14951494
DBG_INF("PASS");
@@ -1812,7 +1811,7 @@ MYSQLND_METHOD(mysqlnd_stmt, result_metadata)(MYSQLND_STMT * const s TSRMLS_DC)
18121811
if (result) {
18131812
result->m.free_result(result, TRUE TSRMLS_CC);
18141813
}
1815-
DBG_RETURN(NULL);
1814+
DBG_RETURN(NULL);
18161815
}
18171816
/* }}} */
18181817

@@ -2367,7 +2366,7 @@ MYSQLND_STMT * _mysqlnd_stmt_init(MYSQLND * const conn TSRMLS_DC)
23672366

23682367
DBG_RETURN(ret);
23692368
} while (0);
2370-
2369+
23712370
SET_OOM_ERROR(conn->error_info);
23722371
if (ret) {
23732372
ret->m->dtor(ret, TRUE TSRMLS_CC);

ext/mysqlnd/mysqlnd_ps_codec.c

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ void _mysqlnd_init_ps_fetch_subsystem()
482482
mysqlnd_ps_fetch_functions[MYSQL_TYPE_DOUBLE].pack_len = 8;
483483
mysqlnd_ps_fetch_functions[MYSQL_TYPE_DOUBLE].php_type = IS_DOUBLE;
484484
mysqlnd_ps_fetch_functions[MYSQL_TYPE_DOUBLE].can_ret_as_str_in_uni = TRUE;
485-
485+
486486
mysqlnd_ps_fetch_functions[MYSQL_TYPE_TIME].func = ps_fetch_time;
487487
mysqlnd_ps_fetch_functions[MYSQL_TYPE_TIME].pack_len = MYSQLND_PS_SKIP_RESULT_W_LEN;
488488
mysqlnd_ps_fetch_functions[MYSQL_TYPE_TIME].php_type = IS_STRING;
@@ -497,7 +497,7 @@ void _mysqlnd_init_ps_fetch_subsystem()
497497
mysqlnd_ps_fetch_functions[MYSQL_TYPE_NEWDATE].pack_len = MYSQLND_PS_SKIP_RESULT_W_LEN;
498498
mysqlnd_ps_fetch_functions[MYSQL_TYPE_NEWDATE].php_type = IS_STRING;
499499
mysqlnd_ps_fetch_functions[MYSQL_TYPE_NEWDATE].can_ret_as_str_in_uni = TRUE;
500-
500+
501501
mysqlnd_ps_fetch_functions[MYSQL_TYPE_DATETIME].func = ps_fetch_datetime;
502502
mysqlnd_ps_fetch_functions[MYSQL_TYPE_DATETIME].pack_len= MYSQLND_PS_SKIP_RESULT_W_LEN;
503503
mysqlnd_ps_fetch_functions[MYSQL_TYPE_DATETIME].php_type= IS_STRING;
@@ -507,7 +507,7 @@ void _mysqlnd_init_ps_fetch_subsystem()
507507
mysqlnd_ps_fetch_functions[MYSQL_TYPE_TIMESTAMP].pack_len= MYSQLND_PS_SKIP_RESULT_W_LEN;
508508
mysqlnd_ps_fetch_functions[MYSQL_TYPE_TIMESTAMP].php_type= IS_STRING;
509509
mysqlnd_ps_fetch_functions[MYSQL_TYPE_TIMESTAMP].can_ret_as_str_in_uni = TRUE;
510-
510+
511511
mysqlnd_ps_fetch_functions[MYSQL_TYPE_TINY_BLOB].func = ps_fetch_string;
512512
mysqlnd_ps_fetch_functions[MYSQL_TYPE_TINY_BLOB].pack_len= MYSQLND_PS_SKIP_RESULT_STR;
513513
mysqlnd_ps_fetch_functions[MYSQL_TYPE_TINY_BLOB].php_type = IS_STRING;
@@ -519,7 +519,7 @@ void _mysqlnd_init_ps_fetch_subsystem()
519519
mysqlnd_ps_fetch_functions[MYSQL_TYPE_BLOB].php_type = IS_STRING;
520520
mysqlnd_ps_fetch_functions[MYSQL_TYPE_BLOB].is_possibly_blob = TRUE;
521521
mysqlnd_ps_fetch_functions[MYSQL_TYPE_BLOB].can_ret_as_str_in_uni = TRUE;
522-
522+
523523
mysqlnd_ps_fetch_functions[MYSQL_TYPE_MEDIUM_BLOB].func = ps_fetch_string;
524524
mysqlnd_ps_fetch_functions[MYSQL_TYPE_MEDIUM_BLOB].pack_len = MYSQLND_PS_SKIP_RESULT_STR;
525525
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
619619
time we try to send > LONG_MAX, the conversion to string will send a string and the server
620620
won't expect it and interpret the value as 0. Thus we need to resend the types, if any such values
621621
occur, and force resend for the next execution.
622-
623622
*/
624623
for (i = 0; i < stmt->param_count; i++) {
625624
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
662661
}
663662
memcpy(tmp_buf, *buf, offset);
664663
*buf = tmp_buf;
665-
664+
666665
/* Update our pos pointer */
667666
*p = *buf + offset;
668667
}
@@ -741,7 +740,7 @@ mysqlnd_stmt_execute_store_params(MYSQLND_STMT * s, zend_uchar **buf, zend_uchar
741740
{
742741
zval *tmp_data = (copies && copies[i])? copies[i]: stmt->param_bind[i].zv;
743742
if (Z_TYPE_P(tmp_data) == IS_STRING) {
744-
goto use_string;
743+
goto use_string;
745744
}
746745
convert_to_long_ex(&tmp_data);
747746
}
@@ -751,7 +750,7 @@ mysqlnd_stmt_execute_store_params(MYSQLND_STMT * s, zend_uchar **buf, zend_uchar
751750
{
752751
zval *tmp_data = (copies && copies[i])? copies[i]: stmt->param_bind[i].zv;
753752
if (Z_TYPE_P(tmp_data) == IS_STRING) {
754-
goto use_string;
753+
goto use_string;
755754
}
756755
convert_to_long_ex(&tmp_data);
757756
}
@@ -793,7 +792,6 @@ mysqlnd_stmt_execute_store_params(MYSQLND_STMT * s, zend_uchar **buf, zend_uchar
793792
data_size += Z_STRLEN_P(the_var);
794793
break;
795794
}
796-
797795
}
798796

799797
/* 2.2 Enlarge the buffer, if needed */

ext/mysqlnd/mysqlnd_result.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,6 @@ MYSQLND_METHOD(mysqlnd_res, unbuffered_free_last_data)(MYSQLND_RES * result TSRM
172172
ctor_called_count,
173173
STAT_COPY_ON_WRITE_SAVED,
174174
result->field_count - ctor_called_count);
175-
176175
/* Free last row's zvals */
177176
mnd_efree(unbuf->last_row_data);
178177
unbuf->last_row_data = NULL;
@@ -506,7 +505,7 @@ mysqlnd_query_read_result_set_header(MYSQLND *conn, MYSQLND_STMT * s TSRMLS_DC)
506505
ret = FAIL;
507506
break;
508507
}
509-
508+
510509
if (FAIL == (ret = result->m.read_result_metadata(result, conn TSRMLS_CC))) {
511510
/* For PS, we leave them in Prepared state */
512511
if (!stmt && conn->current_result) {
@@ -1166,7 +1165,7 @@ MYSQLND_METHOD(mysqlnd_res, store_result_fetch_data)(MYSQLND * const conn, MYSQL
11661165
if (!row_packet) {
11671166
SET_OOM_ERROR(conn->error_info);
11681167
ret = FAIL;
1169-
goto end;
1168+
goto end;
11701169
}
11711170
row_packet->result_set_memory_pool = result->result_set_memory_pool;
11721171
row_packet->field_count = meta->field_count;
@@ -1639,7 +1638,7 @@ MYSQLND_METHOD(mysqlnd_res, fetch_field_data)(MYSQLND_RES * result, unsigned int
16391638
zend_hash_move_forward(Z_ARRVAL(row));
16401639
zend_hash_get_current_data(Z_ARRVAL(row), (void **)&entry);
16411640
}
1642-
1641+
16431642
zend_hash_get_current_data(Z_ARRVAL(row), (void **)&entry);
16441643

16451644
*return_value = **entry;
@@ -1698,7 +1697,7 @@ mysqlnd_result_init(unsigned int field_count, zend_bool persistent TSRMLS_DC)
16981697

16991698
DBG_ENTER("mysqlnd_result_init");
17001699
DBG_INF_FMT("field_count=%u", field_count);
1701-
1700+
17021701
if (!ret) {
17031702
DBG_RETURN(NULL);
17041703
}

ext/mysqlnd/mysqlnd_result_meta.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ MYSQLND_METHOD(mysqlnd_res_meta, read_metadata)(MYSQLND_RES_METADATA * const met
175175
PACKET_FREE(field_packet);
176176
DBG_RETURN(FAIL);
177177
}
178-
178+
179179
if (field_packet->stupid_list_fields_eof == TRUE) {
180180
meta->field_count = i;
181181
break;
@@ -224,7 +224,6 @@ MYSQLND_METHOD(mysqlnd_res_meta, read_metadata)(MYSQLND_RES_METADATA * const met
224224
meta->bit_fields_total_len += 3;/* 120 */
225225
break;
226226
}
227-
228227
}
229228

230229
#if MYSQLND_UNICODE
@@ -475,7 +474,7 @@ mysqlnd_result_meta_init(unsigned int field_count, zend_bool persistent TSRMLS_D
475474
MYSQLND_RES_METADATA *ret = mnd_pecalloc(1, alloc_size, persistent);
476475
DBG_ENTER("mysqlnd_result_meta_init");
477476
DBG_INF_FMT("persistent=%u", persistent);
478-
477+
479478
do {
480479
if (!ret) {
481480
break;

ext/mysqlnd/mysqlnd_statistics.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ mysqlnd_fill_stats_hash(const MYSQLND_STATS * const stats, const MYSQLND_STRING
208208
int ulen, tlen;
209209
#endif
210210
char tmp[25];
211-
211+
212212
sprintf((char *)&tmp, MYSQLND_LLU_SPEC, stats->values[i]);
213213
#if MYSQLND_UNICODE
214214
zend_string_to_unicode(UG(utf8_conv), &ustr, &ulen, names[i].s, names[i].l + 1 TSRMLS_CC);

ext/mysqlnd/mysqlnd_statistics.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ extern const MYSQLND_STRING mysqlnd_stats_values_names[];
6464
MYSQLND_STAT_CALL_TRIGGER((stats), (statistic), (value)); \
6565
MYSQLND_STATS_UNLOCK(_p_s); \
6666
}
67-
67+
6868
#define MYSQLND_DEC_STATISTIC(enabler, stats, statistic) \
6969
{ \
7070
enum_mysqlnd_collected_stats _s = (statistic);\

0 commit comments

Comments
 (0)