From 703fde9fb530bf55bb132e97de9371e5f02864b2 Mon Sep 17 00:00:00 2001 From: Geoff Munn Date: Wed, 6 May 2009 00:02:43 +0000 Subject: [PATCH] BUG FIX: constraints fixed for very long constraint data --- code/MSSQLDatabase.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/MSSQLDatabase.php b/code/MSSQLDatabase.php index e2acff5..867357e 100644 --- a/code/MSSQLDatabase.php +++ b/code/MSSQLDatabase.php @@ -315,7 +315,7 @@ class MSSQLDatabase extends Database { * This is a private MSSQL-only function which returns specific details about a column's constraints (if any) */ private function ColumnConstraints($tableName, $columnName){ - $constraint=$this->query("SELECT CC.CONSTRAINT_NAME, CHECK_CLAUSE, COLUMN_NAME FROM INFORMATION_SCHEMA.CHECK_CONSTRAINTS AS CC INNER JOIN INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE AS CCU ON CCU.CONSTRAINT_NAME=CC.CONSTRAINT_NAME WHERE TABLE_NAME='$tableName' AND COLUMN_NAME='" . $columnName . "';")->first(); + $constraint=$this->query("SELECT CC.CONSTRAINT_NAME, CAST(CHECK_CLAUSE AS TEXT) AS CHECK_CLAUSE, COLUMN_NAME FROM INFORMATION_SCHEMA.CHECK_CONSTRAINTS AS CC INNER JOIN INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE AS CCU ON CCU.CONSTRAINT_NAME=CC.CONSTRAINT_NAME WHERE TABLE_NAME='$tableName' AND COLUMN_NAME='" . $columnName . "';")->first(); return $constraint; }