Skip to content
This repository was archived by the owner on Jun 2, 2025. It is now read-only.

Commit e4df6b9

Browse files
committed
Return true for transactional commands
1 parent fda096c commit e4df6b9

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

wp-includes/sqlite-ast/class-wp-sqlite-driver.php

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,8 @@ public function query( string $query, $fetch_mode = PDO::FETCH_OBJ, ...$fetch_mo
494494
// Handle transaction commands.
495495
$child = $ast->get_first_child();
496496
if ( $child instanceof WP_Parser_Node && 'beginWork' === $child->rule_name ) {
497-
return $this->begin_transaction();
497+
$this->begin_transaction();
498+
return true;
498499
}
499500

500501
if ( $child instanceof WP_Parser_Node && 'simpleStatement' === $child->rule_name ) {
@@ -507,25 +508,29 @@ public function query( string $query, $fetch_mode = PDO::FETCH_OBJ, ...$fetch_mo
507508
WP_MySQL_Lexer::START_SYMBOL === $token1->id
508509
&& WP_MySQL_Lexer::TRANSACTION_SYMBOL === $token2->id
509510
) {
510-
return $this->begin_transaction();
511+
$this->begin_transaction();
512+
return true;
511513
}
512514

513515
if (
514516
WP_MySQL_Lexer::BEGIN_SYMBOL === $token1->id
515517
) {
516-
return $this->begin_transaction();
518+
$this->begin_transaction();
519+
return true;
517520
}
518521

519522
if (
520523
WP_MySQL_Lexer::COMMIT_SYMBOL === $token1->id
521524
) {
522-
return $this->commit();
525+
$this->commit();
526+
return true;
523527
}
524528

525529
if (
526530
WP_MySQL_Lexer::ROLLBACK_SYMBOL === $token1->id
527531
) {
528-
return $this->rollback();
532+
$this->rollback();
533+
return true;
529534
}
530535
}
531536
}

0 commit comments

Comments
 (0)