diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/SimpleSAML/Store/SQL.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/SimpleSAML/Store/SQL.php b/lib/SimpleSAML/Store/SQL.php index 9a3666a..534f2ea 100644 --- a/lib/SimpleSAML/Store/SQL.php +++ b/lib/SimpleSAML/Store/SQL.php @@ -95,7 +95,12 @@ class SimpleSAML_Store_SQL extends SimpleSAML_Store { return; } - $query = 'CREATE TABLE ' . $this->prefix . '_kvstore (_type VARCHAR(30) NOT NULL, _key VARCHAR(50) NOT NULL, _value TEXT NOT NULL, _expire TIMESTAMP, PRIMARY KEY (_key, _type))'; + $text_t = 'TEXT'; + if ($this->driver === 'mysql') { + // TEXT data type has size constraints that can be hit at some point, so we use LONGTEXT instead + $text_t = 'LONGTEXT'; + } + $query = 'CREATE TABLE ' . $this->prefix . '_kvstore (_type VARCHAR(30) NOT NULL, _key VARCHAR(50) NOT NULL, _value '.$text_t.' NOT NULL, _expire TIMESTAMP, PRIMARY KEY (_key, _type))'; $this->pdo->exec($query); $query = 'CREATE INDEX ' . $this->prefix . '_kvstore_expire ON ' . $this->prefix . '_kvstore (_expire)'; |