Skip to content

Commit c740019

Browse files
committed
Drop '#if 0' in mysqlnd_debug() from the MySQLnd extension
Closes GH-5587
1 parent 8bc505c commit c740019

File tree

2 files changed

+57
-8
lines changed

2 files changed

+57
-8
lines changed

ext/mysqli/tests/mysqli_debug_control_string.phpt

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,5 +73,62 @@ if (!$IS_MYSQLND)
7373
print "libmysql/DBUG package prints some debug info here."
7474
?>
7575
--EXPECTF--
76+
Warning: mysqli_debug(): Unrecognized format ',' in %s on line %d
77+
78+
Warning: mysqli_debug(): Consecutive semicolons at position 0 in %s on line %d
7679
[023][control string '%s'] Trace file has not been written.
80+
81+
Warning: mysqli_debug(): Colon expected, 'b' found in %s on line %d
82+
83+
Warning: mysqli_debug(): Colon expected, 'c' found in %s on line %d
84+
85+
Warning: mysqli_debug(): Colon expected, 'B' found in %s on line %d
86+
87+
Warning: mysqli_debug(): Colon expected, 'C' found in %s on line %d
88+
89+
Warning: mysqli_debug(): Colon expected, ',' found in %s on line %d
90+
91+
Warning: mysqli_debug(): Colon expected, '1' found in %s on line %d
92+
93+
Warning: mysqli_debug(): Colon expected, '2' found in %s on line %d
94+
95+
Warning: mysqli_debug(): Colon expected, '3' found in %s on line %d
96+
97+
Warning: mysqli_debug(): Unrecognized format 'b' in %s on line %d
98+
99+
Warning: mysqli_debug(): Colon expected, 'B' found in %s on line %d
100+
101+
Warning: mysqli_debug(): Colon expected, 'C' found in %s on line %d
102+
103+
Warning: mysqli_debug(): Colon expected, ',' found in %s on line %d
104+
105+
Warning: mysqli_debug(): Colon expected, '1' found in %s on line %d
106+
107+
Warning: mysqli_debug(): Colon expected, '2' found in %s on line %d
108+
109+
Warning: mysqli_debug(): Colon expected, '3' found in %s on line %d
110+
111+
Warning: mysqli_debug(): Unrecognized format 'b' in %s on line %d
112+
113+
Warning: mysqli_debug(): Colon expected, ';' found in %s on line %d
114+
115+
Warning: mysqli_debug(): Colon expected, ';' found in %s on line %d
116+
117+
Warning: mysqli_debug(): Colon expected, 'B' found in %s on line %d
118+
119+
Warning: mysqli_debug(): Colon expected, 'C' found in %s on line %d
120+
121+
Warning: mysqli_debug(): Colon expected, ',' found in %s on line %d
122+
123+
Warning: mysqli_debug(): Colon expected, '1' found in %s on line %d
124+
125+
Warning: mysqli_debug(): Colon expected, '2' found in %s on line %d
126+
127+
Warning: mysqli_debug(): Colon expected, '3' found in %s on line %d
128+
129+
Warning: mysqli_debug(): Unrecognized format 'b' in %s on line %d
130+
131+
Warning: mysqli_debug(): Colon expected, ';' found in %s on line %d
132+
133+
Warning: mysqli_debug(): Unrecognized format 'z' in %s on line %d
77134
done%s

ext/mysqlnd/mysqlnd_debug.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -543,11 +543,9 @@ MYSQLND_METHOD(mysqlnd_debug, set_mode)(MYSQLND_DEBUG * self, const char * const
543543
state = PARSER_WAIT_COLON;
544544
break;
545545
case ':':
546-
#if 0
547546
if (state != PARSER_WAIT_COLON) {
548547
php_error_docref(NULL, E_WARNING, "Consecutive semicolons at position %u", i);
549548
}
550-
#endif
551549
state = PARSER_WAIT_MODIFIER;
552550
break;
553551
case 'f': /* limit output to these functions */
@@ -581,10 +579,8 @@ MYSQLND_METHOD(mysqlnd_debug, set_mode)(MYSQLND_DEBUG * self, const char * const
581579
}
582580
i = j;
583581
} else {
584-
#if 0
585582
php_error_docref(NULL, E_WARNING,
586583
"Expected list of functions for '%c' found none", mode[i]);
587-
#endif
588584
}
589585
state = PARSER_WAIT_COLON;
590586
break;
@@ -661,9 +657,7 @@ MYSQLND_METHOD(mysqlnd_debug, set_mode)(MYSQLND_DEBUG * self, const char * const
661657
break;
662658
default:
663659
if (state == PARSER_WAIT_MODIFIER) {
664-
#if 0
665660
php_error_docref(NULL, E_WARNING, "Unrecognized format '%c'", mode[i]);
666-
#endif
667661
if (i+1 < mode_len && mode[i+1] == ',') {
668662
i+= 2;
669663
while (i < mode_len) {
@@ -675,9 +669,7 @@ MYSQLND_METHOD(mysqlnd_debug, set_mode)(MYSQLND_DEBUG * self, const char * const
675669
}
676670
state = PARSER_WAIT_COLON;
677671
} else if (state == PARSER_WAIT_COLON) {
678-
#if 0
679672
php_error_docref(NULL, E_WARNING, "Colon expected, '%c' found", mode[i]);
680-
#endif
681673
}
682674
break;
683675
}

0 commit comments

Comments
 (0)