Moodle

Install error: MySQL says "BLOB/TEXT column 'sessdata' can't have a default value"

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Duplicate
  • Affects Version/s: 1.9
  • Fix Version/s: None
  • Component/s: Database SQL/XMLDB
  • Labels:
    None
  • Environment:
    Apache 2.2.4, MySQL 5.1.17, PHP 5.2.1
  • Database:
    MySQL
  • Affected Branches:
    MOODLE_19_STABLE

Description

During fresh install (from CVS), MySQL says:

1101: BLOB/TEXT column 'sessdata' can't have a default value

ADOConnection._Execute(CREATE TABLE mdl_sessions2 (
sesskey VARCHAR(64) NOT NULL DEFAULT '',
expiry DATETIME NOT NULL,
expireref VARCHAR(25..., false) % line 891, file: adodb.inc.php
ADOConnection.Execute(CREATE TABLE mdl_sessions2 (
sesskey VARCHAR(64) NOT NULL DEFAULT '',
expiry DATETIME NOT NULL,
expireref VARCHAR(25...) % line 89, file: dmllib.php
execute_sql(CREATE TABLE mdl_sessions2 (
sesskey VARCHAR(64) NOT NULL DEFAULT '',
expiry DATETIME NOT NULL,
expireref VARCHAR(25..., true) % line 1899, file: dmllib.php
execute_sql_arr(Array[280]) % line 548, file: ddllib.php
install_from_xmldb_file(D:\Moodle\moodle/lib/db/install.xml) % line 179, file: index.php

This problem did not appeared on MySQL 5.0.33 and 5.0.22, and it seems to have a solution on http://moodle.org/mod/forum/discuss.php?d=58264#p267957

Issue Links

Activity

Hide
Petr Škoda (skodak) added a comment -

Hi, did you turn off the strict mode in MySQL?

Show
Petr Škoda (skodak) added a comment - Hi, did you turn off the strict mode in MySQL?
Hide
Andrei Bautu added a comment -

'sql mode' variable is empty. Do you know if that defaults to strict mode? (I don't think so). However it has nothing to do with strict mode. MySQL Manual states that "DEFAULT does not apply to the BLOB or TEXT types."

Show
Andrei Bautu added a comment - 'sql mode' variable is empty. Do you know if that defaults to strict mode? (I don't think so). However it has nothing to do with strict mode. MySQL Manual states that "DEFAULT does not apply to the BLOB or TEXT types."
Hide
Yu Zhang added a comment -

Thanks Gordon and Andrei. I put Andrei's patch in by using the xmldb editor. It was strange, I didn't do much but just saved it and the default='' in install.xml is gone. This is only in HEAD, please review.

Show
Yu Zhang added a comment - Thanks Gordon and Andrei. I put Andrei's patch in by using the xmldb editor. It was strange, I didn't do much but just saved it and the default='' in install.xml is gone. This is only in HEAD, please review.
Hide
Samuli Karevaara added a comment -

This is a duplicate of MDL-6218.

Show
Samuli Karevaara added a comment - This is a duplicate of MDL-6218.
Hide
Eloy Lafuente (stronk7) added a comment -

Hi, FYI:

I've applied the patch to 18_STABLE so new 1.8 sites won't have TEXT columns with DEFAULT clauses anymore.

Also, as part of 1.9 upgrade, the process will drop automatically the wrong DEFAULT if it existed.

See MDL-6218 for more info.

Ciao

Show
Eloy Lafuente (stronk7) added a comment - Hi, FYI: I've applied the patch to 18_STABLE so new 1.8 sites won't have TEXT columns with DEFAULT clauses anymore. Also, as part of 1.9 upgrade, the process will drop automatically the wrong DEFAULT if it existed. See MDL-6218 for more info. Ciao

People

Dates

  • Created:
    Updated:
    Resolved: