Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test problem - mysql temporary table field size is too long. #3

Open
coalash opened this issue May 2, 2013 · 0 comments
Open

test problem - mysql temporary table field size is too long. #3

coalash opened this issue May 2, 2013 · 0 comments

Comments

@coalash
Copy link

coalash commented May 2, 2013

Problems in lib/gaia/store/mysqlsimple.php

149: "keyname VARCHAR(500) NOT NULL, "

With utf-8 environment, mysql key field maximum size is 255. When exceed, error raised like below.

I recommend

149: "keyname VARCHAR(255) NOT NULL, "


PHP Fatal error: Uncaught exception 'Gaia\Exception' with message 'database error' in /Users/daydreamer/PhpstormProjects/gaia_core_php/lib/gaia/db/except.php:17
Stack trace:
#0 /Users/daydreamer/PhpstormProjects/gaia_core_php/tests/store/mysqlsimple.t(18): Gaia\DB\Except->execute('CREATE TEMPORAR...')
#1 {main}

Debug:
Array
(
[db] => (Gaia\DB\MySQLi object -
[connection] => 127.0.0.1 via TCP/IP
[error] => 1071: Specified key was too long; max key length is 767 bytes
[lastquery] => CREATE TEMPORARY TABLE IF NOT EXISTS gaia_store_mysqlsimple_test (keyname VARCHAR(500) NOT NULL, data BLOB, ttl INT UNSIGNED NOT NULL, revision BIGINT UNSIGNED NOT NULL, UNIQUE keyname (keyname), INDEX ttl (ttl) ) Engine=InnoDB
)
[query] => CREATE TEMPORARY TABLE IF NOT EXISTS gaia_store_mysqlsimple_test (keyname VARCHAR(500) NOT NULL, data BLOB, ttl INT UNSIGNED NOT NULL, revision BIGINT UNSIGNED NOT NULL, UNIQUE keyname (keyname), IN in /Users/daydreamer/PhpstormProjects/gaia_core_php/lib/gaia/db/except.php on line 17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant