case 1382:
case 1479:
case 1541:
case 1554:
case 1626:
return new SyntaxErrorException($exception, $query);
case 1044:
case 1045:
case 1046:
case 1049:
private function handleDriverException(
Driver\Exception $driverException,
?Query $query
): DriverException {
$this->exceptionConverter ??= $this->_driver->getExceptionConverter();
$exception = $this->exceptionConverter->convert($driverException, $query);
if ($exception instanceof ConnectionLost) {
$this->close();
}
Driver\Exception $e,
string $sql,
array $params = [],
array $types = []
): DriverException {
return $this->handleDriverException($e, new Query($sql, $params, $types));
}
/** @internal */
final public function convertException(Driver\Exception $e): DriverException
{
$result = $connection->query($sql);
}
return new Result($result, $this);
} catch (Driver\Exception $e) {
throw $this->convertExceptionDuringQuery($e, $sql, $params, $types);
} finally {
if ($logger !== null) {
$logger->stopQuery();
}
}
$sqlWhere[] = "JSON_CONTAINS(i.filters, '{\"fid\":\"".$fid."\"}')";
}
$querySQL .= implode(' AND ', $sqlWhere) . ' AND i.status = 1 AND i.lng = \'' . $lng . '\'';
$statement = $this->entityManager->getConnection()->executeQuery($querySQL);
$results = $statement->fetchAllAssociative();
if ($results)
{
$productIDs = [];
'pages' => $pages,
'page' => $page,
));
}
$result = $this->entityManager->getRepository(ItemNew::class)->search($searchData);
// dd($result);
$allFilters = $this->entityManager->getRepository(ItemNew::class)->generateFilters($searchData);
$total = count($allFilters);
$this->dispatcher->dispatch($event, KernelEvents::CONTROLLER_ARGUMENTS);
$controller = $event->getController();
$arguments = $event->getArguments();
// call controller
$response = $controller(...$arguments);
// view
if (!$response instanceof Response) {
$event = new ViewEvent($this, $request, $type, $response);
$this->dispatcher->dispatch($event, KernelEvents::VIEW);
{
$request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
$this->requestStack->push($request);
try {
return $this->handleRaw($request, $type);
} catch (\Exception $e) {
if ($e instanceof RequestExceptionInterface) {
$e = new BadRequestHttpException($e->getMessage(), $e);
}
if (false === $catch) {
$this->boot();
++$this->requestStackSize;
$this->resetServices = true;
try {
return $this->getHttpKernel()->handle($request, $type, $catch);
} finally {
--$this->requestStackSize;
}
}
Request::setTrustedHosts([$trustedHosts]);
}
$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);
} else {
$code = $exception->getCode();
$sqlState = null;
}
return new self($exception->getMessage(), $sqlState, $code, $exception);
}
}
$stmt = $this->connection->query($sql);
assert($stmt instanceof PDOStatement);
return new Result($stmt);
} catch (PDOException $exception) {
throw Exception::new($exception);
}
}
/**
* {@inheritdoc}
return $this->wrappedConnection->prepare($sql);
}
public function query(string $sql): Result
{
return $this->wrappedConnection->query($sql);
}
/**
* {@inheritdoc}
*/
}
$query->start();
try {
$result = parent::query($sql);
} finally {
$query->stop();
if (null !== $this->stopwatch) {
$this->stopwatch->stop('doctrine');
$this->bindParameters($stmt, $params, $types);
$result = $stmt->execute();
} else {
$result = $connection->query($sql);
}
return new Result($result, $this);
} catch (Driver\Exception $e) {
throw $this->convertExceptionDuringQuery($e, $sql, $params, $types);
$sqlWhere[] = "JSON_CONTAINS(i.filters, '{\"fid\":\"".$fid."\"}')";
}
$querySQL .= implode(' AND ', $sqlWhere) . ' AND i.status = 1 AND i.lng = \'' . $lng . '\'';
$statement = $this->entityManager->getConnection()->executeQuery($querySQL);
$results = $statement->fetchAllAssociative();
if ($results)
{
$productIDs = [];
'pages' => $pages,
'page' => $page,
));
}
$result = $this->entityManager->getRepository(ItemNew::class)->search($searchData);
// dd($result);
$allFilters = $this->entityManager->getRepository(ItemNew::class)->generateFilters($searchData);
$total = count($allFilters);
$this->dispatcher->dispatch($event, KernelEvents::CONTROLLER_ARGUMENTS);
$controller = $event->getController();
$arguments = $event->getArguments();
// call controller
$response = $controller(...$arguments);
// view
if (!$response instanceof Response) {
$event = new ViewEvent($this, $request, $type, $response);
$this->dispatcher->dispatch($event, KernelEvents::VIEW);
{
$request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
$this->requestStack->push($request);
try {
return $this->handleRaw($request, $type);
} catch (\Exception $e) {
if ($e instanceof RequestExceptionInterface) {
$e = new BadRequestHttpException($e->getMessage(), $e);
}
if (false === $catch) {
$this->boot();
++$this->requestStackSize;
$this->resetServices = true;
try {
return $this->getHttpKernel()->handle($request, $type, $catch);
} finally {
--$this->requestStackSize;
}
}
Request::setTrustedHosts([$trustedHosts]);
}
$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);
}
public function query(string $sql): ResultInterface
{
try {
$stmt = $this->connection->query($sql);
assert($stmt instanceof PDOStatement);
return new Result($stmt);
} catch (PDOException $exception) {
throw Exception::new($exception);
}
public function query(string $sql): ResultInterface
{
try {
$stmt = $this->connection->query($sql);
assert($stmt instanceof PDOStatement);
return new Result($stmt);
} catch (PDOException $exception) {
throw Exception::new($exception);
return $this->wrappedConnection->prepare($sql);
}
public function query(string $sql): Result
{
return $this->wrappedConnection->query($sql);
}
/**
* {@inheritdoc}
*/
}
$query->start();
try {
$result = parent::query($sql);
} finally {
$query->stop();
if (null !== $this->stopwatch) {
$this->stopwatch->stop('doctrine');
$this->bindParameters($stmt, $params, $types);
$result = $stmt->execute();
} else {
$result = $connection->query($sql);
}
return new Result($result, $this);
} catch (Driver\Exception $e) {
throw $this->convertExceptionDuringQuery($e, $sql, $params, $types);
$sqlWhere[] = "JSON_CONTAINS(i.filters, '{\"fid\":\"".$fid."\"}')";
}
$querySQL .= implode(' AND ', $sqlWhere) . ' AND i.status = 1 AND i.lng = \'' . $lng . '\'';
$statement = $this->entityManager->getConnection()->executeQuery($querySQL);
$results = $statement->fetchAllAssociative();
if ($results)
{
$productIDs = [];
'pages' => $pages,
'page' => $page,
));
}
$result = $this->entityManager->getRepository(ItemNew::class)->search($searchData);
// dd($result);
$allFilters = $this->entityManager->getRepository(ItemNew::class)->generateFilters($searchData);
$total = count($allFilters);
$this->dispatcher->dispatch($event, KernelEvents::CONTROLLER_ARGUMENTS);
$controller = $event->getController();
$arguments = $event->getArguments();
// call controller
$response = $controller(...$arguments);
// view
if (!$response instanceof Response) {
$event = new ViewEvent($this, $request, $type, $response);
$this->dispatcher->dispatch($event, KernelEvents::VIEW);
{
$request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
$this->requestStack->push($request);
try {
return $this->handleRaw($request, $type);
} catch (\Exception $e) {
if ($e instanceof RequestExceptionInterface) {
$e = new BadRequestHttpException($e->getMessage(), $e);
}
if (false === $catch) {
$this->boot();
++$this->requestStackSize;
$this->resetServices = true;
try {
return $this->getHttpKernel()->handle($request, $type, $catch);
} finally {
--$this->requestStackSize;
}
}
Request::setTrustedHosts([$trustedHosts]);
}
$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);
[3/3]
SyntaxErrorException
|
---|
Doctrine\DBAL\Exception\SyntaxErrorException: An exception occurred while executing a query: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND i.status = 1 AND i.lng = 'en'' at line 1 at vendor/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php:86 at Doctrine\DBAL\Driver\API\MySQL\ExceptionConverter->convert() (vendor/doctrine/dbal/src/Connection.php:1908) at Doctrine\DBAL\Connection->handleDriverException() (vendor/doctrine/dbal/src/Connection.php:1851) at Doctrine\DBAL\Connection->convertExceptionDuringQuery() (vendor/doctrine/dbal/src/Connection.php:1070) at Doctrine\DBAL\Connection->executeQuery() (src/Repository/Product/ItemNewRepository.php:137) at App\Repository\Product\ItemNewRepository->search() (src/Controller/SearchController.php:278) at App\Controller\SearchController->searchNew() (vendor/symfony/http-kernel/HttpKernel.php:163) at Symfony\Component\HttpKernel\HttpKernel->handleRaw() (vendor/symfony/http-kernel/HttpKernel.php:75) at Symfony\Component\HttpKernel\HttpKernel->handle() (vendor/symfony/http-kernel/Kernel.php:202) at Symfony\Component\HttpKernel\Kernel->handle() (public/index.php:22) |
[2/3]
Exception
|
---|
Doctrine\DBAL\Driver\PDO\Exception: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND i.status = 1 AND i.lng = 'en'' at line 1 at vendor/doctrine/dbal/src/Driver/PDO/Exception.php:28 at Doctrine\DBAL\Driver\PDO\Exception::new() (vendor/doctrine/dbal/src/Driver/PDO/Connection.php:74) at Doctrine\DBAL\Driver\PDO\Connection->query() (vendor/doctrine/dbal/src/Driver/Middleware/AbstractConnectionMiddleware.php:33) at Doctrine\DBAL\Driver\Middleware\AbstractConnectionMiddleware->query() (vendor/symfony/doctrine-bridge/Middleware/Debug/Connection.php:62) at Symfony\Bridge\Doctrine\Middleware\Debug\Connection->query() (vendor/doctrine/dbal/src/Connection.php:1065) at Doctrine\DBAL\Connection->executeQuery() (src/Repository/Product/ItemNewRepository.php:137) at App\Repository\Product\ItemNewRepository->search() (src/Controller/SearchController.php:278) at App\Controller\SearchController->searchNew() (vendor/symfony/http-kernel/HttpKernel.php:163) at Symfony\Component\HttpKernel\HttpKernel->handleRaw() (vendor/symfony/http-kernel/HttpKernel.php:75) at Symfony\Component\HttpKernel\HttpKernel->handle() (vendor/symfony/http-kernel/Kernel.php:202) at Symfony\Component\HttpKernel\Kernel->handle() (public/index.php:22) |
[1/3]
PDOException
|
---|
PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND i.status = 1 AND i.lng = 'en'' at line 1 at vendor/doctrine/dbal/src/Driver/PDO/Connection.php:69 at PDO->query() (vendor/doctrine/dbal/src/Driver/PDO/Connection.php:69) at Doctrine\DBAL\Driver\PDO\Connection->query() (vendor/doctrine/dbal/src/Driver/Middleware/AbstractConnectionMiddleware.php:33) at Doctrine\DBAL\Driver\Middleware\AbstractConnectionMiddleware->query() (vendor/symfony/doctrine-bridge/Middleware/Debug/Connection.php:62) at Symfony\Bridge\Doctrine\Middleware\Debug\Connection->query() (vendor/doctrine/dbal/src/Connection.php:1065) at Doctrine\DBAL\Connection->executeQuery() (src/Repository/Product/ItemNewRepository.php:137) at App\Repository\Product\ItemNewRepository->search() (src/Controller/SearchController.php:278) at App\Controller\SearchController->searchNew() (vendor/symfony/http-kernel/HttpKernel.php:163) at Symfony\Component\HttpKernel\HttpKernel->handleRaw() (vendor/symfony/http-kernel/HttpKernel.php:75) at Symfony\Component\HttpKernel\HttpKernel->handle() (vendor/symfony/http-kernel/Kernel.php:202) at Symfony\Component\HttpKernel\Kernel->handle() (public/index.php:22) |