Moodle

Upgraing to a new Moodle 1.7 /1.7.1 version fails with SQL problem on Numerical Plugin

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.7, 1.7.1
  • Fix Version/s: 1.7.2, 1.8
  • Component/s: Database SQL/XMLDB
  • Labels:
    None
  • Environment:
    MSSQL,PHP 5.2, IIS6, ODBTP 1.1.4
  • Database:
    Microsoft SQL
  • Affected Branches:
    MOODLE_17_STABLE
  • Fixed Branches:
    MOODLE_17_STABLE, MOODLE_18_STABLE

Description

Upgraing to a new Moodle 1.7 /1.7.1 version fails with a SQL error on the Numerical Plugin with the following message:

numerical plugin needs upgrading
(mssql): select c.name,t.name,c.length, (case when c.xusertype=61 then 0 else c.xprec end), (case when c.xusertype=61 then 0 else c.xscale end) from syscolumns c join systypes t on t.xusertype=c.xusertype join sysobjects o on o.id=c.id where o.name='MDL_QUESTION_ANSWERS' (mssql): UPDATE mdl_question_answers SET answer = '*' WHERE answer = '' AND question IN (SELECT id FROM mdl_question WHERE qtype = 'numerical') 402: [42000][402][SQL Server][Level 16, State 1, Server AGR-SQL1\INST01, Line 1]The data types ntext and varchar are incompatible in the equal to operator.

ADOConnection._Execute(UPDATE mdl_question_answers SET answer = '*' WHERE answer = '' AND question IN (SELECT id FROM mdl_question WHERE qtype = 'numer..., false) % line 889, file: adodb.inc.php
ADOConnection.Execute(UPDATE mdl_question_answers SET answer = '*' WHERE answer = '' AND question IN (SELECT id FROM mdl_question WHERE qtype = 'numer...) % line 1117, file: dmllib.php
set_field_select(question_answers, answer, *, answer = '' AND question IN (SELECT id FROM mdl_question WHERE qtype = 'numerical')) % line 30, file: upgrade.php
xmldb_qtype_numerical_upgrade(2006032200) % line 142, file: adminlib.php
upgrade_plugins(qtype, question/type, http://e-learning.agr.no/admin/index.php) % line 316, file: index.php

Upgrading numerical from 2006032200 to 2006032201 FAILED

Activity

Hide
Eloy Lafuente (stronk7) added a comment -

Yep. It's due to one limitation under MSSQL when compating varchar and text fields.

Can you test if the attached question/type/numerical/db/upgrade.php file performs the upgrade successfully?

TIA!

Show
Eloy Lafuente (stronk7) added a comment - Yep. It's due to one limitation under MSSQL when compating varchar and text fields. Can you test if the attached question/type/numerical/db/upgrade.php file performs the upgrade successfully? TIA!
Hide
Eloy Lafuente (stronk7) added a comment -

alternate upgrade file to work under MSSQL

Show
Eloy Lafuente (stronk7) added a comment - alternate upgrade file to work under MSSQL
Hide
Thomas Forsberg added a comment -

Worked perfectly !

Show
Thomas Forsberg added a comment - Worked perfectly !
Hide
Eloy Lafuente (stronk7) added a comment -

Thanks for feedback, Thomas.

Now it's present both if the migration to 1.7.1+ and 1.8.

Closing this...ciao

Show
Eloy Lafuente (stronk7) added a comment - Thanks for feedback, Thomas. Now it's present both if the migration to 1.7.1+ and 1.8. Closing this...ciao

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: