Skip to content

Commit da3a01f

Browse files
authored
Merge pull request #238 from iTearo/master
Fix metadata parsing for distributed RENAME queries
2 parents f79dfb7 + 8765ba2 commit da3a01f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Transport/Http.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -636,8 +636,12 @@ private function prepareWrite($sql, $bindings = []): CurlerRequest
636636
if (strpos($sql, 'ON CLUSTER') === false) {
637637
return $this->getRequestWrite($query);
638638
}
639-
640-
if (strpos($sql, 'CREATE') === 0 || strpos($sql, 'DROP') === 0 || strpos($sql, 'ALTER') === 0) {
639+
if (
640+
str_starts_with($sql, 'CREATE')
641+
|| str_starts_with($sql, 'DROP')
642+
|| str_starts_with($sql, 'ALTER')
643+
|| str_starts_with($sql, 'RENAME')
644+
) {
641645
$query->setFormat('JSON');
642646
}
643647

0 commit comments

Comments
 (0)