Error when session table is updated |
[eluser]LuckyFella73[/eluser]
Hi, I get the following error message when I try to load a page: Code: Error Number: 1064 When I refresh the page the message is gone. I autoload the session class btw. It's my first project using CI 2.1.1 (I did the upgrade from 2.1 to 2.1.1, overwriting system folder and index.php on root) Does anyone know what may cause that error message?
[eluser]weboap[/eluser]
recreate your session table with the latest table schem from http://ellislab.com/codeigniter/user-gui...sions.html section : Saving Session Data to a Database
[eluser]CroNiX[/eluser]
I don't think it's the table. It looks like CI is getting the "protect identifiers" wrong in that query. Notice the tickmarks: '`< 1340198948`' I'd file a bug report on that one. Strange that no one else has seen this?
[eluser]LuckyFella73[/eluser]
I did a table export to compare with the Userguide table template: Code: CREATE TABLE `jaz_sessions` ( I don't know what happend to me - I could swear I defined utf8_unicode while I have utf8_bin as COLLATE.. never happend to me before. I guess that was the problem? Sorry I didn't checkthat before - I guess I did the mistake when setting up the database COLLATE because I allways take session tables from older projects (export/import) having COLLATE set to utf8_unicode. But when setting the DB itself to utf8_bin I guess the tabel COLLAT is overwritten .. I will re-setup the DB and table - in case I get the same error I'll post that here. Thanks for you help anyway!
[eluser]InsiteFX[/eluser]
LuckyFella73, that is the wrong table here is the correct one Code: -- ------------------------------------------------------------------------
[eluser]CroNiX[/eluser]
Not sure how a table will affect a query that is written wrong. The protect identifiers is generating the wrong sql. There are tickmarks around `< 1340198948` which is breaking the query. This was a problem with the initial release of 2.1.1, which they claim they fixed and rereleased (haven't tested it). Are you sure all of your code is up to date with the most current version of CI, downloaded since they rereleased it?
[eluser]InsiteFX[/eluser]
He's missing the last_activity_idx KEY according to his table which would throw the error, But not sure, I am using the newest CI.
[eluser]CroNiX[/eluser]
Well, that needs to be fixed as well, but the specific error has to do with this wrongly generated internal CI query, which would never work no matter what table it was tried on due to the tickmarks around the "less than timestamp", which isn't a field: Code: DELETE FROM `jaz_sessions` WHERE `last_activity` `< 1340198948`
[eluser]InsiteFX[/eluser]
True, I belive thay have fixed it with the newest CI ver on GitHub.
[eluser]LuckyFella73[/eluser]
@ Cronix Quote:Are you sure all of your code is up to date with the most current version of CI, downloaded since they rereleased it? I'm quite sure I downloaded the initial version - didn't know that it was rereleased! I will update my table again, download the corrected version 2.1.1 and replace my system folder again. @ InsideFX Thank you for giving me the table sql. I'm still confused because the upgrade instructions from 2.1.0 to 2.1.1 state: Quote:ALTER TABLE ci_sessions CHANGE ip_address ip_address varchar(45) default '0' NOT NULL So I guess I have to take your table sql and just replace the "16" for the column ip_address with "45". Thanks again for all the input! |
Welcome Guest, Not a member yet? Register Sign In |