| line |
true |
false |
branch |
|
199
|
0 |
0 |
if (self->state != STATE_IDLE) return; |
|
200
|
0 |
0 |
if (!ngx_queue_empty(&self->send_queue)) { |
|
216
|
0 |
0 |
if (cbt_freelist) { |
|
227
|
0 |
0 |
if (cbt_freelist_size >= MAX_FREELIST_DEPTH) { |
|
243
|
0 |
0 |
if (send_freelist) { |
|
254
|
0 |
0 |
if (send_freelist_size >= MAX_FREELIST_DEPTH) { |
|
266
|
0 |
15 |
while (cbt_freelist) { |
|
272
|
0 |
15 |
while (send_freelist) { |
|
295
|
0 |
2 |
while (!ngx_queue_empty(&self->send_queue)) { |
|
304
|
0 |
2 |
while (!ngx_queue_empty(&self->cb_queue)) { |
|
317
|
0 |
0 |
if (!self->reading && self->fd >= 0) { |
|
|
0 |
0 |
if (!self->reading && self->fd >= 0) { |
|
324
|
0 |
2 |
if (self->reading) { |
|
331
|
0 |
0 |
if (!self->writing && self->fd >= 0) { |
|
|
0 |
0 |
if (!self->writing && self->fd >= 0) { |
|
338
|
0 |
2 |
if (self->writing) { |
|
349
|
0 |
0 |
if (ms == 0) ms = 1; |
|
350
|
0 |
0 |
if (self->timing) ev_timer_stop(self->loop, &self->timer); |
|
357
|
0 |
2 |
if (self->timing) { |
|
364
|
0 |
0 |
if (status & (MYSQL_WAIT_READ | MYSQL_WAIT_EXCEPT)) start_reading(self); else stop_reading(self); |
|
365
|
0 |
0 |
if (status & MYSQL_WAIT_WRITE) start_writing(self); else stop_writing(self); |
|
366
|
0 |
0 |
if (status & MYSQL_WAIT_TIMEOUT) start_timer(self); else stop_timer(self); |
|
377
|
0 |
0 |
if (self->magic == EV_MARIADB_FREED && |
|
378
|
0 |
0 |
self->callback_depth == 0) { |
|
387
|
0 |
0 |
if (NULL == self->on_error) return; |
|
393
|
0 |
0 |
PUSHMARK(SP); |
|
394
|
0 |
0 |
XPUSHs(sv_2mortal(newSVpv(msg, 0))); |
|
398
|
0 |
0 |
if (SvTRUE(ERRSV)) { |
|
|
0 |
0 |
if (SvTRUE(ERRSV)) { |
|
399
|
0 |
0 |
warn("EV::MariaDB: exception in error handler: %s", SvPV_nolen(ERRSV)); |
|
400
|
0 |
0 |
sv_setpvn(ERRSV, "", 0); |
|
403
|
0 |
0 |
FREETMPS; |
|
413
|
0 |
0 |
if (ngx_queue_empty(&self->cb_queue)) return NULL; |
|
431
|
0 |
0 |
PUSHMARK(SP); |
|
436
|
0 |
0 |
if (SvTRUE(ERRSV)) { |
|
|
0 |
0 |
if (SvTRUE(ERRSV)) { |
|
437
|
0 |
0 |
warn("EV::MariaDB: exception in callback: %s", SvPV_nolen(ERRSV)); |
|
438
|
0 |
0 |
sv_setpvn(ERRSV, "", 0); |
|
441
|
0 |
0 |
FREETMPS; |
|
450
|
0 |
0 |
PUSHMARK(SP); |
|
454
|
0 |
0 |
if (SvTRUE(ERRSV)) { |
|
|
0 |
0 |
if (SvTRUE(ERRSV)) { |
|
455
|
0 |
0 |
warn("EV::MariaDB: exception in stream callback: %s", SvPV_nolen(ERRSV)); |
|
456
|
0 |
0 |
sv_setpvn(ERRSV, "", 0); |
|
459
|
0 |
0 |
FREETMPS; |
|
466
|
0 |
0 |
if (SvTRUE(ERRSV)) { |
|
|
0 |
0 |
if (SvTRUE(ERRSV)) { |
|
467
|
0 |
0 |
warn("EV::MariaDB: exception in callback: %s", SvPV_nolen(ERRSV)); |
|
468
|
0 |
0 |
sv_setpvn(ERRSV, "", 0); |
|
478
|
0 |
0 |
if (cb == NULL) { |
|
479
|
0 |
0 |
if (res) { |
|
492
|
0 |
0 |
PUSHMARK(SP); |
|
494
|
0 |
0 |
if (res == NULL && mysql_field_count(self->conn) > 0) { |
|
|
0 |
0 |
if (res == NULL && mysql_field_count(self->conn) > 0) { |
|
498
|
0 |
0 |
else if (res != NULL) { |
|
507
|
0 |
0 |
if (nrows > 0) av_extend(rows, (SSize_t)(nrows < (my_ulonglong)SSize_t_MAX ? nrows - 1 : SSize_t_MAX)); |
|
|
0 |
0 |
if (nrows > 0) av_extend(rows, (SSize_t)(nrows < (my_ulonglong)SSize_t_MAX ? nrows - 1 : SSize_t_MAX)); |
|
508
|
0 |
0 |
while ((row = mysql_fetch_row(res)) != NULL) { |
|
512
|
0 |
0 |
if (ncols > 0) av_extend(r, ncols - 1); |
|
513
|
0 |
0 |
for (c = 0; c < ncols; c++) { |
|
514
|
0 |
0 |
if (row[c] == NULL) { |
|
518
|
0 |
0 |
if (self->utf8 && is_utf8_charset(fields[c].charsetnr)) |
|
|
0 |
0 |
if (self->utf8 && is_utf8_charset(fields[c].charsetnr)) |
|
540
|
0 |
0 |
FREETMPS; |
|
551
|
0 |
0 |
if (cb == NULL) return 0; |
|
565
|
0 |
0 |
if (cb == NULL) { |
|
576
|
0 |
0 |
PUSHMARK(SP); |
|
580
|
0 |
0 |
FREETMPS; |
|
590
|
0 |
0 |
int is_fork = IS_FORKED(self); |
|
|
0 |
0 |
int is_fork = IS_FORKED(self); |
|
600
|
0 |
0 |
if (self->op_data_ptr) { |
|
616
|
0 |
0 |
while (ctx) { |
|
618
|
0 |
0 |
if (!is_fork && ctx->stmt) { |
|
|
0 |
0 |
if (!is_fork && ctx->stmt) { |
|
619
|
0 |
0 |
if (ctx->stmt == self->op_stmt) |
|
630
|
0 |
0 |
if (is_fork) { |
|
635
|
0 |
0 |
if (self->op_result && saved_fd >= 0) |
|
|
0 |
0 |
if (self->op_result && saved_fd >= 0) |
|
638
|
0 |
0 |
if (self->op_stmt) { |
|
642
|
0 |
0 |
if (self->op_result) { |
|
646
|
0 |
0 |
if (self->conn) { |
|
661
|
0 |
2 |
if (!ngx_queue_empty(&self->send_queue)) { |
|
666
|
0 |
2 |
if (!ngx_queue_empty(&self->cb_queue)) { |
|
675
|
0 |
2 |
if (self->stream_cb) { |
|
683
|
0 |
2 |
while (!ngx_queue_empty(&local_send)) { |
|
696
|
0 |
2 |
while (!ngx_queue_empty(&local_cb)) { |
|
726
|
2 |
0 |
if (has_arg) { |
|
727
|
0 |
2 |
if (NULL != *slot) { |
|
731
|
2 |
0 |
if (NULL != handler && SvOK(handler) && |
|
|
2 |
0 |
if (NULL != handler && SvOK(handler) && |
|
732
|
2 |
0 |
SvROK(handler) && SvTYPE(SvRV(handler)) == SVt_PVCV) { |
|
|
2 |
0 |
SvROK(handler) && SvTYPE(SvRV(handler)) == SVt_PVCV) { |
|
739
|
2 |
0 |
: &PL_sv_undef; |
|
749
|
0 |
0 |
if (status != 0) { |
|
761
|
0 |
0 |
if (self->op_ret > 0) { |
|
768
|
0 |
0 |
if (check_destroyed(self)) return; |
|
769
|
0 |
0 |
if (self->state != STATE_IDLE) return; |
|
770
|
0 |
0 |
if (self->conn && mysql_more_results(self->conn)) { |
|
|
0 |
0 |
if (self->conn && mysql_more_results(self->conn)) { |
|
778
|
0 |
0 |
if (self->op_ret == -1) { |
|
784
|
0 |
0 |
if (mysql_field_count(self->conn) > 0) { |
|
786
|
0 |
0 |
if (status != 0) { |
|
792
|
0 |
0 |
if (self->op_result) { |
|
799
|
0 |
0 |
if (!mysql_more_results(self->conn)) |
|
803
|
0 |
0 |
if (status != 0) { |
|
831
|
0 |
0 |
if (check_destroyed(self)) return; |
|
832
|
0 |
0 |
if (self->state != STATE_IDLE) return; |
|
834
|
0 |
0 |
if (check_destroyed(self)) return; |
|
835
|
0 |
0 |
if (self->state != STATE_IDLE) return; |
|
845
|
0 |
0 |
if (self->op_ret != 0) { |
|
862
|
0 |
0 |
if (self->op_bool_ret != 0) { |
|
866
|
0 |
0 |
if (deliver_error(self, mysql_error(self->conn))) return; |
|
867
|
0 |
0 |
if (self->state != STATE_IDLE) return; |
|
869
|
0 |
0 |
if (self->conn && mysql_more_results(self->conn)) { |
|
|
0 |
0 |
if (self->conn && mysql_more_results(self->conn)) { |
|
877
|
0 |
0 |
if (mysql_field_count(self->conn) > 0) { |
|
880
|
0 |
0 |
if (status != 0) { |
|
892
|
0 |
0 |
if (deliver_result(self)) return; |
|
893
|
0 |
0 |
if (self->state != STATE_IDLE) return; |
|
895
|
0 |
0 |
if (self->conn && mysql_more_results(self->conn)) { |
|
|
0 |
0 |
if (self->conn && mysql_more_results(self->conn)) { |
|
905
|
0 |
0 |
if (self->draining) { |
|
909
|
0 |
0 |
if (res) mysql_free_result(res); |
|
910
|
0 |
0 |
if (self->conn && mysql_more_results(self->conn)) { |
|
|
0 |
0 |
if (self->conn && mysql_more_results(self->conn)) { |
|
912
|
0 |
0 |
if (status != 0) { |
|
929
|
0 |
0 |
if (deliver_result(self)) return; |
|
930
|
0 |
0 |
if (self->state != STATE_IDLE) return; |
|
932
|
0 |
0 |
if (self->conn && mysql_more_results(self->conn)) { |
|
|
0 |
0 |
if (self->conn && mysql_more_results(self->conn)) { |
|
957
|
0 |
0 |
while (!ngx_queue_empty(&self->send_queue) && |
|
958
|
0 |
0 |
self->send_count < MAX_PIPELINE_DEPTH) { |
|
965
|
0 |
0 |
if (status != 0) { |
|
975
|
0 |
0 |
if (self->op_ret != 0) { |
|
987
|
0 |
0 |
while (self->send_count > 0) { |
|
990
|
0 |
0 |
if (status != 0) { |
|
997
|
0 |
0 |
if (self->op_bool_ret != 0) { |
|
1000
|
0 |
0 |
if (deliver_error(self, mysql_error(self->conn))) return; |
|
1002
|
0 |
0 |
if (self->state != STATE_IDLE) return; |
|
1003
|
0 |
0 |
if (self->conn && mysql_more_results(self->conn)) { |
|
|
0 |
0 |
if (self->conn && mysql_more_results(self->conn)) { |
|
1007
|
0 |
0 |
if (!ngx_queue_empty(&self->send_queue)) goto send_phase; |
|
1011
|
0 |
0 |
if (mysql_field_count(self->conn) > 0) { |
|
1014
|
0 |
0 |
if (status != 0) { |
|
1023
|
0 |
0 |
if (deliver_result(self)) return; |
|
1025
|
0 |
0 |
if (self->state != STATE_IDLE) return; |
|
1026
|
0 |
0 |
if (self->conn && mysql_more_results(self->conn)) { |
|
|
0 |
0 |
if (self->conn && mysql_more_results(self->conn)) { |
|
1031
|
0 |
0 |
if (!ngx_queue_empty(&self->send_queue)) goto send_phase; |
|
1043
|
0 |
0 |
if (self->op_conn_ret == NULL) { |
|
1049
|
0 |
0 |
if (check_destroyed(self)) return; |
|
1052
|
0 |
0 |
if (self->state != STATE_IDLE) return; |
|
1054
|
0 |
0 |
if (check_destroyed(self)) return; |
|
1055
|
0 |
0 |
if (self->state != STATE_IDLE) return; |
|
1068
|
0 |
0 |
if (self->fd < 0) { |
|
1072
|
0 |
0 |
if (check_destroyed(self)) return; |
|
1073
|
0 |
0 |
if (self->state != STATE_IDLE) return; |
|
1075
|
0 |
0 |
if (check_destroyed(self)) return; |
|
1076
|
0 |
0 |
if (self->state != STATE_IDLE) return; |
|
1084
|
0 |
0 |
if (NULL != self->on_connect) { |
|
1092
|
0 |
0 |
PUSHMARK(SP); |
|
1096
|
0 |
0 |
if (SvTRUE(ERRSV)) { |
|
|
0 |
0 |
if (SvTRUE(ERRSV)) { |
|
1097
|
0 |
0 |
warn("EV::MariaDB: exception in connect handler: %s", SvPV_nolen(ERRSV)); |
|
1098
|
0 |
0 |
sv_setpvn(ERRSV, "", 0); |
|
1101
|
0 |
0 |
FREETMPS; |
|
1106
|
0 |
0 |
if (check_destroyed(self)) return; |
|
1120
|
0 |
0 |
if (self->op_ret != 0) { |
|
1124
|
0 |
0 |
if (deliver_error(self, errbuf)) return; |
|
1135
|
0 |
0 |
if (deliver_value(self, newSViv(PTR2IV(ctx)))) return; |
|
1145
|
0 |
0 |
if (self->op_ret != 0) { |
|
1146
|
0 |
0 |
if (deliver_error(self, mysql_stmt_error(stmt))) return; |
|
1157
|
0 |
0 |
if (cb == NULL) { |
|
1158
|
0 |
0 |
if (self->op_result) { |
|
1172
|
0 |
0 |
PUSHMARK(SP); |
|
1174
|
0 |
0 |
if (self->op_result == NULL) { |
|
1198
|
0 |
0 |
for (c = 0; c < ncols; c++) { |
|
1200
|
0 |
0 |
if (buflen < 256) buflen = 256; |
|
1210
|
0 |
0 |
if (mysql_stmt_bind_result(stmt, bind)) { |
|
1221
|
0 |
0 |
while ((fetch_ret = mysql_stmt_fetch(stmt)) == 0) { |
|
1223
|
0 |
0 |
if (ncols > 0) av_extend(row, ncols - 1); |
|
1224
|
0 |
0 |
for (c = 0; c < ncols; c++) { |
|
1225
|
0 |
0 |
if (is_null[c]) { |
|
1229
|
0 |
0 |
if (self->utf8 && is_utf8_charset(fields[c].charsetnr)) |
|
|
0 |
0 |
if (self->utf8 && is_utf8_charset(fields[c].charsetnr)) |
|
1237
|
0 |
0 |
if (fetch_ret != 0 && fetch_ret != MYSQL_NO_DATA) { |
|
|
0 |
0 |
if (fetch_ret != 0 && fetch_ret != MYSQL_NO_DATA) { |
|
1243
|
0 |
0 |
if (fetch_ret == MYSQL_DATA_TRUNCATED) |
|
1261
|
0 |
0 |
FREETMPS; |
|
1265
|
0 |
0 |
if (check_destroyed(self)) return; |
|
1271
|
0 |
0 |
if (self->op_ret != 0) { |
|
1275
|
0 |
0 |
if (deliver_error(self, mysql_stmt_error(stmt))) return; |
|
1284
|
0 |
0 |
while (*pp) { |
|
1285
|
0 |
0 |
if (*pp == ctx) { *pp = ctx->next; return; } |
|
1292
|
0 |
0 |
if (self->op_stmt_ctx) { |
|
1298
|
0 |
0 |
if (self->op_bool_ret != 0) { |
|
1299
|
0 |
0 |
if (deliver_error(self, mysql_error(self->conn))) return; |
|
1301
|
0 |
0 |
if (deliver_value(self, newSViv(1))) return; |
|
1310
|
0 |
0 |
if (self->op_bool_ret != 0) { |
|
1311
|
0 |
0 |
if (deliver_error(self, mysql_stmt_error(stmt))) return; |
|
1313
|
0 |
0 |
if (deliver_value(self, newSViv(1))) return; |
|
1326
|
0 |
0 |
while (ctx) { |
|
1328
|
0 |
0 |
if (ctx->stmt) { |
|
1341
|
0 |
0 |
if (failed) { |
|
1348
|
0 |
0 |
if (self->pending_user) { |
|
1353
|
0 |
0 |
if (self->pending_password) { |
|
1358
|
0 |
0 |
if (self->pending_database) { |
|
1363
|
0 |
0 |
if (self->pending_charset) { |
|
1374
|
0 |
0 |
if (!failed && (prev == STATE_RESET_CONNECTION || prev == STATE_CHANGE_USER)) |
|
|
0 |
0 |
if (!failed && (prev == STATE_RESET_CONNECTION || prev == STATE_CHANGE_USER)) |
|
|
0 |
0 |
if (!failed && (prev == STATE_RESET_CONNECTION || prev == STATE_CHANGE_USER)) |
|
1376
|
0 |
0 |
if (failed) { |
|
1377
|
0 |
0 |
if (deliver_error(self, mysql_error(self->conn))) return; |
|
1379
|
0 |
0 |
if (deliver_value(self, newSViv(1))) return; |
|
1387
|
0 |
0 |
if (status == 0) on_utility_done(self, failed); |
|
1393
|
0 |
0 |
if (!ctx->bind_params) return; |
|
1394
|
0 |
0 |
for (i = 0; i < ctx->bind_param_count; i++) { |
|
1405
|
0 |
0 |
if (self->op_ret != 0) { |
|
1410
|
0 |
0 |
if (status == 0) { |
|
1435
|
0 |
0 |
if (self->op_ret != 0) { |
|
1437
|
0 |
0 |
if (check_destroyed(self)) return; |
|
1443
|
0 |
0 |
if (!self->op_result) { |
|
1445
|
0 |
0 |
if (err && err[0]) { |
|
|
0 |
0 |
if (err && err[0]) { |
|
1447
|
0 |
0 |
if (check_destroyed(self)) return; |
|
1457
|
0 |
0 |
if (check_destroyed(self)) return; |
|
1464
|
0 |
0 |
if (status == 0) { |
|
1473
|
0 |
0 |
MYSQL_FIELD *fields = (self->utf8 && self->op_result) |
|
1474
|
0 |
0 |
? mysql_fetch_fields(self->op_result) : NULL; |
|
1479
|
0 |
0 |
if (row == NULL) break; |
|
1488
|
0 |
0 |
if (ncols > 0) av_extend(r, ncols - 1); |
|
1489
|
0 |
0 |
for (c = 0; c < ncols; c++) { |
|
1490
|
0 |
0 |
if (row[c] == NULL) { |
|
1494
|
0 |
0 |
if (fields && is_utf8_charset(fields[c].charsetnr)) |
|
|
0 |
0 |
if (fields && is_utf8_charset(fields[c].charsetnr)) |
|
1513
|
0 |
0 |
PUSHMARK(SP); |
|
1517
|
0 |
0 |
if (SvTRUE(ERRSV)) { |
|
|
0 |
0 |
if (SvTRUE(ERRSV)) { |
|
1518
|
0 |
0 |
warn("EV::MariaDB: exception in stream callback: %s", SvPV_nolen(ERRSV)); |
|
1519
|
0 |
0 |
sv_setpvn(ERRSV, "", 0); |
|
1521
|
0 |
0 |
FREETMPS; |
|
1525
|
0 |
0 |
if (check_destroyed(self)) { |
|
1531
|
0 |
0 |
if (self->stream_cb != NULL) { |
|
1537
|
0 |
0 |
} else if (self->conn == NULL || self->op_result == NULL) { |
|
|
0 |
0 |
} else if (self->conn == NULL || self->op_result == NULL) { |
|
1552
|
0 |
0 |
if (status != 0) { |
|
1565
|
0 |
0 |
int has_error = (err && err[0]); |
|
|
0 |
0 |
int has_error = (err && err[0]); |
|
1566
|
0 |
0 |
if (has_error) COPY_ERROR(errbuf, err); |
|
1575
|
0 |
0 |
if (has_error) { |
|
1581
|
0 |
0 |
if (check_destroyed(self)) return; |
|
1583
|
0 |
0 |
if (self->conn && mysql_more_results(self->conn)) { |
|
|
0 |
0 |
if (self->conn && mysql_more_results(self->conn)) { |
|
1609
|
0 |
0 |
if (check_destroyed(self)) { |
|
1614
|
0 |
0 |
if (cb) { |
|
1621
|
0 |
0 |
PUSHMARK(SP); |
|
1625
|
0 |
0 |
FREETMPS; |
|
1629
|
0 |
0 |
if (check_destroyed(self)) return; |
|
1639
|
0 |
0 |
if (self->op_data_ptr) { |
|
1646
|
0 |
0 |
if (self->op_bool_ret != 0) { |
|
1647
|
0 |
0 |
if (deliver_error(self, mysql_stmt_error(stmt))) return; |
|
1649
|
0 |
0 |
if (deliver_value(self, newSViv(1))) return; |
|
1662
|
0 |
0 |
if (status == 0) { |
|
1671
|
0 |
0 |
if (status == 0) { |
|
1680
|
0 |
0 |
if (status == 0) { |
|
1689
|
0 |
0 |
if (status == 0) { |
|
1698
|
0 |
0 |
if (status == 0) { |
|
1707
|
0 |
0 |
if (status == 0) { |
|
1716
|
0 |
0 |
if (status == 0) { |
|
1725
|
0 |
0 |
if (status == 0) { |
|
1734
|
0 |
0 |
if (status == 0) { |
|
1743
|
0 |
0 |
if (status == 0) { |
|
1792
|
0 |
0 |
if (status == 0) { |
|
1801
|
0 |
0 |
if (status == 0) { |
|
1810
|
0 |
0 |
if (status == 0) { |
|
1819
|
0 |
0 |
if (status == 0) { |
|
1837
|
0 |
0 |
if (self->magic != EV_MARIADB_MAGIC) return; |
|
1838
|
0 |
0 |
if (NULL == self->conn) return; |
|
1840
|
0 |
0 |
if (revents & EV_READ) events |= MYSQL_WAIT_READ | MYSQL_WAIT_EXCEPT; |
|
1841
|
0 |
0 |
if (revents & EV_WRITE) events |= MYSQL_WAIT_WRITE; |
|
1851
|
0 |
0 |
if (self->magic != EV_MARIADB_MAGIC) return; |
|
1852
|
0 |
0 |
if (NULL == self->conn) return; |
|
1861
|
0 |
0 |
if (!s) return NULL; |
|
1871
|
0 |
0 |
return (s && s[0]) ? newSVpv(s, 0) : &PL_sv_undef; |
|
|
0 |
0 |
return (s && s[0]) ? newSVpv(s, 0) : &PL_sv_undef; |
|
1902
|
0 |
0 |
if (self->connect_timeout > 0) |
|
1904
|
0 |
0 |
if (self->read_timeout > 0) |
|
1906
|
0 |
0 |
if (self->write_timeout > 0) |
|
1908
|
0 |
0 |
if (self->compress) |
|
1910
|
0 |
0 |
if (self->charset) |
|
1912
|
0 |
0 |
if (self->init_command) |
|
1914
|
0 |
0 |
if (self->ssl_ca || self->ssl_capath || self->ssl_cert || self->ssl_key || self->ssl_cipher) |
|
|
0 |
0 |
if (self->ssl_ca || self->ssl_capath || self->ssl_cert || self->ssl_key || self->ssl_cipher) |
|
|
0 |
0 |
if (self->ssl_ca || self->ssl_capath || self->ssl_cert || self->ssl_key || self->ssl_cipher) |
|
|
0 |
0 |
if (self->ssl_ca || self->ssl_capath || self->ssl_cert || self->ssl_key || self->ssl_cipher) |
|
|
0 |
0 |
if (self->ssl_ca || self->ssl_capath || self->ssl_cert || self->ssl_key || self->ssl_cipher) |
|
1916
|
0 |
0 |
if (self->ssl_verify_server_cert) { |
|
1920
|
0 |
0 |
if (self->multi_statements) |
|
1922
|
0 |
0 |
if (self->found_rows) |
|
1933
|
0 |
0 |
return charsetnr == 33 || charsetnr == 83 |
|
1934
|
0 |
0 |
|| (charsetnr >= 192 && charsetnr <= 211) |
|
|
0 |
0 |
|| (charsetnr >= 192 && charsetnr <= 211) |
|
1935
|
0 |
0 |
|| charsetnr == 45 || charsetnr == 46 |
|
|
0 |
0 |
|| charsetnr == 45 || charsetnr == 46 |
|
1936
|
0 |
0 |
|| (charsetnr >= 224 && charsetnr <= 247) |
|
|
0 |
0 |
|| (charsetnr >= 224 && charsetnr <= 247) |
|
1937
|
0 |
0 |
|| charsetnr == 255 |
|
1938
|
0 |
0 |
|| (charsetnr >= 256 && charsetnr <= 309) |
|
|
0 |
0 |
|| (charsetnr >= 256 && charsetnr <= 309) |
|
1939
|
0 |
0 |
|| (charsetnr >= 2048 && charsetnr <= 2559); |
|
|
0 |
0 |
|| (charsetnr >= 2048 && charsetnr <= 2559); |
|
|
0 |
0 |
|| (charsetnr >= 2048 && charsetnr <= 2559); |
|
1944
|
0 |
0 |
if (!conn) return 0; |
|
1946
|
0 |
0 |
return (cs && strncmp(cs, "utf8", 4) == 0); |
|
|
0 |
0 |
return (cs && strncmp(cs, "utf8", 4) == 0); |
|
1953
|
0 |
0 |
if (ncols > 0) av_extend(fnames, ncols - 1); |
|
1954
|
0 |
0 |
for (i = 0; i < ncols; i++) { |
|
1956
|
0 |
0 |
if (utf8_names) |
|
1970
|
0 |
0 |
if ((unsigned long)nparams != expected) |
|
1974
|
0 |
0 |
if (nparams == 0) return; |
|
1982
|
0 |
0 |
for (i = 0; i < nparams; i++) { |
|
1984
|
0 |
0 |
if (svp && SvOK(*svp)) { |
|
|
0 |
0 |
if (svp && SvOK(*svp)) { |
|
1985
|
0 |
0 |
if (SvIOK(*svp)) { |
|
1988
|
0 |
0 |
if (SvIsUV(*svp)) { |
|
1997
|
0 |
0 |
} else if (SvNOK(*svp)) { |
|
2020
|
0 |
0 |
if (mysql_stmt_bind_param(ctx->stmt, bp)) { |
|
2032
|
0 |
0 |
if (NULL == self->conn) { |
|
2045
|
0 |
0 |
if (status == 0) { |
|
2049
|
0 |
0 |
if (self->fd < 0) { |
|
2066
|
0 |
15 |
I_EV_API("EV::MariaDB"); |
|
|
15 |
0 |
I_EV_API("EV::MariaDB"); |
|
|
0 |
15 |
I_EV_API("EV::MariaDB"); |
|
2093
|
0 |
2 |
if (self->magic != EV_MARIADB_MAGIC) |
|
2102
|
0 |
2 |
if (PL_dirty) { |
|
2105
|
0 |
0 |
int is_fork = IS_FORKED(self); |
|
|
0 |
0 |
int is_fork = IS_FORKED(self); |
|
2106
|
0 |
0 |
while (!ngx_queue_empty(&self->send_queue)) { |
|
2113
|
0 |
0 |
while (!ngx_queue_empty(&self->cb_queue)) { |
|
2119
|
0 |
0 |
if (self->op_data_ptr) Safefree(self->op_data_ptr); |
|
2127
|
0 |
0 |
while (ctx) { |
|
2130
|
0 |
0 |
if (!is_fork && ctx->stmt) { |
|
|
0 |
0 |
if (!is_fork && ctx->stmt) { |
|
2131
|
0 |
0 |
if (ctx->stmt == self->op_stmt) self->op_stmt = NULL; |
|
2138
|
0 |
0 |
if (!is_fork) { |
|
2139
|
0 |
0 |
if (self->op_result) mysql_free_result(self->op_result); |
|
2140
|
0 |
0 |
if (self->conn) mysql_close(self->conn); |
|
2153
|
0 |
2 |
if (self->op_data_ptr) { |
|
2165
|
0 |
2 |
int is_fork = IS_FORKED(self); |
|
|
0 |
0 |
int is_fork = IS_FORKED(self); |
|
2167
|
0 |
2 |
while (ctx) { |
|
2170
|
0 |
0 |
if (!is_fork && ctx->stmt) { |
|
|
0 |
0 |
if (!is_fork && ctx->stmt) { |
|
2174
|
0 |
0 |
if (ctx->stmt == self->op_stmt) self->op_stmt = NULL; |
|
2182
|
2 |
0 |
if (!is_fork && self->op_stmt && !self->op_stmt_ctx) { |
|
|
0 |
2 |
if (!is_fork && self->op_stmt && !self->op_stmt_ctx) { |
|
|
0 |
0 |
if (!is_fork && self->op_stmt && !self->op_stmt_ctx) { |
|
2188
|
0 |
2 |
if (is_fork) { |
|
2192
|
0 |
2 |
if (self->op_result) { |
|
2199
|
0 |
2 |
if (conn) mysql_close(conn); |
|
2208
|
0 |
2 |
if ((cb = self->on_connect)) { self->on_connect = NULL; SvREFCNT_dec(cb); } |
|
2209
|
2 |
0 |
if ((cb = self->on_error)) { self->on_error = NULL; SvREFCNT_dec(cb); } |
|
2219
|
2 |
0 |
if (self->callback_depth == 0) |
|
2227
|
0 |
0 |
if (NULL != self->conn) { |
|
2228
|
0 |
0 |
croak(self->state == STATE_CONNECTING |
|
2242
|
0 |
0 |
if (unix_socket_sv && SvOK(unix_socket_sv)) { |
|
|
0 |
0 |
if (unix_socket_sv && SvOK(unix_socket_sv)) { |
|
2253
|
0 |
0 |
if (NULL == self->host) { |
|
2259
|
0 |
0 |
if (check_destroyed(self)) return; |
|
2260
|
0 |
0 |
if (self->state != STATE_IDLE) return; |
|
2271
|
0 |
0 |
if (check_destroyed(self)) return; |
|
2299
|
0 |
0 |
if (NULL == self->conn) { |
|
2302
|
0 |
0 |
if (IS_FORKED(self)) { |
|
|
0 |
0 |
if (IS_FORKED(self)) { |
|
2305
|
0 |
0 |
if (self->state >= STATE_STMT_PREPARE) { |
|
2308
|
0 |
0 |
if (!(SvROK(cb) && SvTYPE(SvRV(cb)) == SVt_PVCV)) { |
|
|
0 |
0 |
if (!(SvROK(cb) && SvTYPE(SvRV(cb)) == SVt_PVCV)) { |
|
2315
|
0 |
0 |
if (self->state == STATE_IDLE && self->callback_depth == 0) |
|
|
0 |
0 |
if (self->state == STATE_IDLE && self->callback_depth == 0) |
|
2329
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
2332
|
0 |
0 |
if (NULL == stmt) { |
|
2346
|
0 |
0 |
if (status == 0) { |
|
2360
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
2363
|
0 |
0 |
CHECK_STMT(ctx); |
|
|
0 |
0 |
CHECK_STMT(ctx); |
|
2365
|
0 |
0 |
if (SvOK(params_ref)) { |
|
2366
|
0 |
0 |
if (!SvROK(params_ref) || SvTYPE(SvRV(params_ref)) != SVt_PVAV) |
|
|
0 |
0 |
if (!SvROK(params_ref) || SvTYPE(SvRV(params_ref)) != SVt_PVAV) |
|
2377
|
0 |
0 |
if (status == 0) { |
|
2390
|
0 |
0 |
if (NULL == self->conn || self->state == STATE_CONNECTING) |
|
|
0 |
0 |
if (NULL == self->conn || self->state == STATE_CONNECTING) |
|
2392
|
0 |
0 |
if (IS_FORKED(self)) |
|
|
0 |
0 |
if (IS_FORKED(self)) |
|
2394
|
0 |
0 |
if (self->state != STATE_IDLE) |
|
2396
|
0 |
0 |
if (self->send_count > 0) |
|
2398
|
0 |
0 |
if (!SvROK(params_ref) || SvTYPE(SvRV(params_ref)) != SVt_PVAV) |
|
|
0 |
0 |
if (!SvROK(params_ref) || SvTYPE(SvRV(params_ref)) != SVt_PVAV) |
|
2402
|
0 |
0 |
CHECK_STMT(ctx); |
|
|
0 |
0 |
CHECK_STMT(ctx); |
|
2413
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
2416
|
0 |
0 |
if (!ctx) croak("invalid statement handle"); |
|
2417
|
0 |
0 |
if (ctx->closed) { |
|
2422
|
0 |
0 |
if (deliver_value(self, newSViv(1))) return; |
|
2433
|
0 |
0 |
if (status == 0) { |
|
2447
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
2450
|
0 |
0 |
CHECK_STMT(ctx); |
|
|
0 |
0 |
CHECK_STMT(ctx); |
|
2456
|
0 |
0 |
if (status == 0) { |
|
2469
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
2485
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
2487
|
0 |
0 |
db = (SvOK(db_sv)) ? SvPV_nolen(db_sv) : NULL; |
|
2495
|
0 |
0 |
if (db) replace_str(&self->pending_database, db); |
|
2511
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
2529
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
2544
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
2562
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
2577
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
2592
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
2609
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
2617
|
0 |
0 |
if (status == 0) { |
|
2630
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
2636
|
0 |
0 |
if (status == 0) { |
|
2652
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
|
0 |
0 |
CHECK_READY(self, cb); |
|
2655
|
0 |
0 |
CHECK_STMT(ctx); |
|
|
0 |
0 |
CHECK_STMT(ctx); |
|
2658
|
0 |
0 |
Newx(data, data_len > 0 ? data_len : 1, char); |
|
2668
|
0 |
0 |
if (status == 0) { |
|
2679
|
0 |
0 |
if (strcmp(key, "connect_timeout") == 0) { |
|
2681
|
0 |
0 |
} else if (strcmp(key, "read_timeout") == 0) { |
|
2683
|
0 |
0 |
} else if (strcmp(key, "write_timeout") == 0) { |
|
2685
|
0 |
0 |
} else if (strcmp(key, "compress") == 0) { |
|
2687
|
0 |
0 |
} else if (strcmp(key, "multi_statements") == 0) { |
|
2689
|
0 |
0 |
} else if (strcmp(key, "found_rows") == 0) { |
|
2691
|
0 |
0 |
} else if (strcmp(key, "charset") == 0) { |
|
2692
|
0 |
0 |
SET_STR_OPTION(charset); |
|
|
0 |
0 |
SET_STR_OPTION(charset); |
|
2693
|
0 |
0 |
} else if (strcmp(key, "init_command") == 0) { |
|
2694
|
0 |
0 |
SET_STR_OPTION(init_command); |
|
|
0 |
0 |
SET_STR_OPTION(init_command); |
|
2695
|
0 |
0 |
} else if (strcmp(key, "ssl_key") == 0) { |
|
2696
|
0 |
0 |
SET_STR_OPTION(ssl_key); |
|
|
0 |
0 |
SET_STR_OPTION(ssl_key); |
|
2697
|
0 |
0 |
} else if (strcmp(key, "ssl_cert") == 0) { |
|
2698
|
0 |
0 |
SET_STR_OPTION(ssl_cert); |
|
|
0 |
0 |
SET_STR_OPTION(ssl_cert); |
|
2699
|
0 |
0 |
} else if (strcmp(key, "ssl_ca") == 0) { |
|
2700
|
0 |
0 |
SET_STR_OPTION(ssl_ca); |
|
|
0 |
0 |
SET_STR_OPTION(ssl_ca); |
|
2701
|
0 |
0 |
} else if (strcmp(key, "ssl_capath") == 0) { |
|
2702
|
0 |
0 |
SET_STR_OPTION(ssl_capath); |
|
|
0 |
0 |
SET_STR_OPTION(ssl_capath); |
|
2703
|
0 |
0 |
} else if (strcmp(key, "ssl_cipher") == 0) { |
|
2704
|
0 |
0 |
SET_STR_OPTION(ssl_cipher); |
|
|
0 |
0 |
SET_STR_OPTION(ssl_cipher); |
|
2705
|
0 |
0 |
} else if (strcmp(key, "ssl_verify_server_cert") == 0) { |
|
2707
|
0 |
0 |
} else if (strcmp(key, "utf8") == 0) { |
|
2718
|
0 |
1 |
RETVAL = (NULL != self->conn && self->state != STATE_CONNECTING) ? 1 : 0; |
|
|
0 |
0 |
RETVAL = (NULL != self->conn && self->state != STATE_CONNECTING) ? 1 : 0; |
|
|
0 |
1 |
RETVAL = (NULL != self->conn && self->state != STATE_CONNECTING) ? 1 : 0; |
|
2727
|
0 |
0 |
RETVAL = self->conn ? str_or_undef(mysql_error(self->conn)) : &PL_sv_undef; |
|
2736
|
0 |
0 |
RETVAL = (NULL != self->conn) ? mysql_errno(self->conn) : 0; |
|
|
0 |
0 |
RETVAL = (NULL != self->conn) ? mysql_errno(self->conn) : 0; |
|
2745
|
0 |
0 |
RETVAL = self->conn ? str_or_undef(mysql_sqlstate(self->conn)) : &PL_sv_undef; |
|
2754
|
0 |
0 |
if (NULL != self->conn) { |
|
2769
|
0 |
0 |
RETVAL = (NULL != self->conn) ? mysql_warning_count(self->conn) : 0; |
|
|
0 |
0 |
RETVAL = (NULL != self->conn) ? mysql_warning_count(self->conn) : 0; |
|
2778
|
0 |
0 |
RETVAL = self->conn ? str_or_undef(mysql_info(self->conn)) : &PL_sv_undef; |
|
2787
|
0 |
0 |
RETVAL = (NULL != self->conn) ? (UV)mysql_get_server_version(self->conn) : 0; |
|
|
0 |
0 |
RETVAL = (NULL != self->conn) ? (UV)mysql_get_server_version(self->conn) : 0; |
|
2796
|
0 |
0 |
RETVAL = self->conn ? str_or_undef(mysql_get_server_info(self->conn)) : &PL_sv_undef; |
|
2805
|
0 |
0 |
RETVAL = (NULL != self->conn) ? (UV)mysql_thread_id(self->conn) : 0; |
|
|
0 |
0 |
RETVAL = (NULL != self->conn) ? (UV)mysql_thread_id(self->conn) : 0; |
|
2814
|
0 |
0 |
RETVAL = self->conn ? str_or_undef(mysql_get_host_info(self->conn)) : &PL_sv_undef; |
|
2823
|
0 |
0 |
RETVAL = self->conn ? str_or_undef(mysql_character_set_name(self->conn)) : &PL_sv_undef; |
|
2832
|
0 |
0 |
RETVAL = (NULL != self->conn) ? (int)mysql_get_socket(self->conn) : -1; |
|
|
0 |
0 |
RETVAL = (NULL != self->conn) ? (int)mysql_get_socket(self->conn) : -1; |
|
2841
|
0 |
0 |
if (NULL != self->conn) { |
|
2843
|
0 |
0 |
RETVAL = (rows == (my_ulonglong)-1) ? &PL_sv_undef : newSVuv((UV)rows); |
|
2860
|
0 |
0 |
if (NULL == self->conn || self->state == STATE_CONNECTING || IS_FORKED(self)) |
|
|
0 |
0 |
if (NULL == self->conn || self->state == STATE_CONNECTING || IS_FORKED(self)) |
|
|
0 |
0 |
if (NULL == self->conn || self->state == STATE_CONNECTING || IS_FORKED(self)) |
|
|
0 |
0 |
if (NULL == self->conn || self->state == STATE_CONNECTING || IS_FORKED(self)) |
|
2862
|
0 |
0 |
if (self->state == STATE_CLOSE) |
|
2865
|
0 |
0 |
if (SvUTF8(str)) { |
|
2867
|
0 |
0 |
if (!cs || (strncmp(cs, "utf8", 4) != 0)) { |
|
|
0 |
0 |
if (!cs || (strncmp(cs, "utf8", 4) != 0)) { |
|
2868
|
0 |
0 |
warn("EV::MariaDB: escaping a UTF-8 string on a non-utf8 connection (%s) may cause corruption or injection vulnerabilities", cs ? cs : "unknown"); |
|
2871
|
0 |
0 |
if (len > (STRLEN)((~(STRLEN)0) / 2 - 1)) |
|
2876
|
0 |
0 |
if (elen == (unsigned long)-1) { |
|
2890
|
0 |
0 |
RETVAL = self->pending_count; |
|
2899
|
0 |
0 |
if (self->state != STATE_IDLE || self->send_count > 0) { |
|
|
0 |
0 |
if (self->state != STATE_IDLE || self->send_count > 0) { |
|
2903
|
0 |
0 |
if (check_destroyed(self)) return; |