Skip to content
Snippets Groups Projects
Commit dbc3cbf0 authored by Jaime Perez Crespo's avatar Jaime Perez Crespo
Browse files

Use LONGTEXT instead of the TEXT data type in MySQL to avoid size constraints...

Use LONGTEXT instead of the TEXT data type in MySQL to avoid size constraints in the latter. This resolves #399.
parent 6b529186
No related branches found
No related tags found
No related merge requests found
......@@ -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)';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment