fuel / orm

Fuel PHP Framework - Fuel v1.x ORM
http://fuelphp.com/docs/packages/orm/intro.html
152 stars 96 forks source link

SQLlite 1.8 error #391

Closed petrololovich closed 7 years ago

petrololovich commented 8 years ago

SQLSTATE[HY000]: General error: 1 near "LIMIT": syntax error with query: "DELETE FROM "products_images" WHERE "image_id" = 8 LIMIT 1"

FuelPHP prev version: /core/classes/database/query/builder/delete.php

        if ($this->_limit !== NULL && substr($db->_db_type, 0, 6) !== 'sqlite')
        {
            // Add limiting
            $query .= ' LIMIT '.$this->_limit;
        }

FuelPHP 1.8 version: /core/classes/database/query/builder/delete.php

        if ($this->_limit !== null)
        {
            // Add limiting
            $query .= ' LIMIT '.$this->_limit;
        }
WanWizard commented 8 years ago

As of 1.8, hacks in the generic PDO driver have been moved to platform specific drivers. So switch to the SQLite driver.

See also https://github.com/fuel/core/wiki/Changelog-v1.8#backward-compatibility-notes