Skip to content

Commit d2790f9

Browse files
authored
Silence internal warnings unknown command (code=9, code=22)
Silence internal warnings unknown command (code=9, code=22) manticoresoftware/manticoresearch#130
1 parent e714c5e commit d2790f9

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/Drivers/Mysqli/Connection.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,18 @@ public function query($query)
9393
{
9494
$this->ensureConnection();
9595

96-
$resource = $this->getConnection()->query($query);
96+
set_error_handler(function () {});
97+
try {
98+
/**
99+
* ManticoreSearch/Sphinx silence warnings thrown by php mysqli/mysqlnd
100+
*
101+
* unknown command (code=9) - status() command not implemented by Sphinx/ManticoreSearch
102+
* ERROR mysqli::prepare(): (08S01/1047): unknown command (code=22) - prepare() not implemented by Sphinx/Manticore
103+
*/
104+
$resource = @$this->getConnection()->query($query);
105+
} finally {
106+
restore_error_handler();
107+
}
97108

98109
if ($this->getConnection()->error) {
99110
throw new DatabaseException('['.$this->getConnection()->errno.'] '.

0 commit comments

Comments
 (0)