Skip to content

Commit 3fb0994

Browse files
committed
Revert "Skip profiling of sqlite3_step"
This reverts commit bb31a75. It doesn't seem like this actually fixed the problem.
1 parent 4ad5388 commit 3fb0994

File tree

2 files changed

+1
-46
lines changed

2 files changed

+1
-46
lines changed

ext/pdo_sqlite/sqlite_statement.c

+1-17
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@
2626
#include "php_pdo_sqlite.h"
2727
#include "php_pdo_sqlite_int.h"
2828

29-
#ifdef HAVE_VALGRIND
30-
# include "valgrind/callgrind.h"
31-
#endif
3229

3330
static int pdo_sqlite_stmt_dtor(pdo_stmt_t *stmt)
3431
{
@@ -51,14 +48,7 @@ static int pdo_sqlite_stmt_execute(pdo_stmt_t *stmt)
5148
}
5249

5350
S->done = 0;
54-
#ifdef HAVE_VALGRIND
55-
CALLGRIND_TOGGLE_COLLECT;
56-
#endif
57-
int result = sqlite3_step(S->stmt);
58-
#ifdef HAVE_VALGRIND
59-
CALLGRIND_TOGGLE_COLLECT;
60-
#endif
61-
switch (result) {
51+
switch (sqlite3_step(S->stmt)) {
6252
case SQLITE_ROW:
6353
S->pre_fetched = 1;
6454
php_pdo_stmt_set_column_count(stmt, sqlite3_data_count(S->stmt));
@@ -224,13 +214,7 @@ static int pdo_sqlite_stmt_fetch(pdo_stmt_t *stmt,
224214
if (S->done) {
225215
return 0;
226216
}
227-
#ifdef HAVE_VALGRIND
228-
CALLGRIND_TOGGLE_COLLECT;
229-
#endif
230217
i = sqlite3_step(S->stmt);
231-
#ifdef HAVE_VALGRIND
232-
CALLGRIND_TOGGLE_COLLECT;
233-
#endif
234218
switch (i) {
235219
case SQLITE_ROW:
236220
return 1;

ext/sqlite3/sqlite3.c

-29
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@
3131
#include "SAPI.h"
3232
#include "sqlite3_arginfo.h"
3333

34-
#ifdef HAVE_VALGRIND
35-
# include "valgrind/callgrind.h"
36-
#endif
37-
3834
ZEND_DECLARE_MODULE_GLOBALS(sqlite3)
3935

4036
static PHP_GINIT_FUNCTION(sqlite3);
@@ -599,14 +595,7 @@ PHP_METHOD(SQLite3, query)
599595
result->column_count = -1;
600596
ZVAL_OBJ(&result->stmt_obj_zval, Z_OBJ(stmt));
601597

602-
603-
#ifdef HAVE_VALGRIND
604-
CALLGRIND_TOGGLE_COLLECT;
605-
#endif
606598
return_code = sqlite3_step(result->stmt_obj->stmt);
607-
#ifdef HAVE_VALGRIND
608-
CALLGRIND_TOGGLE_COLLECT;
609-
#endif
610599

611600
switch (return_code) {
612601
case SQLITE_ROW: /* Valid Row */
@@ -708,13 +697,7 @@ PHP_METHOD(SQLite3, querySingle)
708697
RETURN_FALSE;
709698
}
710699

711-
#ifdef HAVE_VALGRIND
712-
CALLGRIND_TOGGLE_COLLECT;
713-
#endif
714700
return_code = sqlite3_step(stmt);
715-
#ifdef HAVE_VALGRIND
716-
CALLGRIND_TOGGLE_COLLECT;
717-
#endif
718701

719702
switch (return_code) {
720703
case SQLITE_ROW: /* Valid Row */
@@ -1813,13 +1796,7 @@ PHP_METHOD(SQLite3Stmt, execute)
18131796
RETURN_FALSE;
18141797
}
18151798

1816-
#ifdef HAVE_VALGRIND
1817-
CALLGRIND_TOGGLE_COLLECT;
1818-
#endif
18191799
return_code = sqlite3_step(stmt_obj->stmt);
1820-
#ifdef HAVE_VALGRIND
1821-
CALLGRIND_TOGGLE_COLLECT;
1822-
#endif
18231800

18241801
switch (return_code) {
18251802
case SQLITE_ROW: /* Valid Row */
@@ -1976,13 +1953,7 @@ PHP_METHOD(SQLite3Result, fetchArray)
19761953

19771954
SQLITE3_CHECK_INITIALIZED(result_obj->db_obj, result_obj->stmt_obj->initialised, SQLite3Result)
19781955

1979-
#ifdef HAVE_VALGRIND
1980-
CALLGRIND_TOGGLE_COLLECT;
1981-
#endif
19821956
ret = sqlite3_step(result_obj->stmt_obj->stmt);
1983-
#ifdef HAVE_VALGRIND
1984-
CALLGRIND_TOGGLE_COLLECT;
1985-
#endif
19861957
switch (ret) {
19871958
case SQLITE_ROW:
19881959
/* If there was no return value then just skip fetching */

0 commit comments

Comments
 (0)