From 535f038daaa1b558e3ae8f3093481c499d190635 Mon Sep 17 00:00:00 2001 From: El RIDO Date: Mon, 24 Jan 2022 21:43:31 +0100 Subject: [PATCH] handle `LIMIT` in oci Co-authored-by: Austin Huang --- lib/Data/Database.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/Data/Database.php b/lib/Data/Database.php index 8dcbe0c5..aed8db69 100644 --- a/lib/Data/Database.php +++ b/lib/Data/Database.php @@ -913,7 +913,10 @@ class Database extends AbstractData case '0.21': // create the meta column if necessary (pre 0.21 change) try { - self::$_db->exec('SELECT "meta" FROM "' . self::_sanitizeIdentifier('paste') . '" LIMIT 1'); + self::$_db->exec( + 'SELECT "meta" FROM "' . self::_sanitizeIdentifier('paste') . '" ' . + (self::$_type === 'oci' ? 'FETCH NEXT 1 ROWS ONLY' : 'LIMIT 1') + ); } catch (PDOException $e) { self::$_db->exec('ALTER TABLE "' . self::_sanitizeIdentifier('paste') . '" ADD COLUMN "meta" TEXT'); }