Issue Details (XML | Word | Printable)

Key: MDL-16655
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Critical Critical
Assignee: Eloy Lafuente (stronk7)
Reporter: John White
Votes: 0
Watchers: 0
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

SUBSTR function in accesslib.php fails on MS SQL

Created: 24/Sep/08 08:56 PM   Updated: 08/Oct/08 05:27 AM
Return to search
Component/s: Course
Affects Version/s: 1.9.1, 1.9.2
Fix Version/s: 1.9.3

Environment: Microsoft SQL

Database: Microsoft SQL
Participants: Eloy Lafuente (stronk7) and John White
Security Level: None
QA Assignee: Petr Skoda
Resolved date: 25/Sep/08
Affected Branches: MOODLE_19_STABLE
Fixed Branches: MOODLE_19_STABLE


 Description  « Hide
lib/accesslib.php makes a call to SQL function SUBSTR in the statement:
    $sql = "UPDATE {$CFG->prefix}context
            SET path = ".sql_concat("'$newpath'", 'SUBSTR(path, '.$len.' +1)')."
                $setdepth
            WHERE path LIKE '{$frompath}/%'";
    execute_sql($sql,false);

but SUBSTR is not legitimate in MSSQL, SUBSTRING must be used, which is fine with MySQL except there may be a difference in the length parameter.

Problem discussed at:
http://moodle.org/mod/forum/discuss.php?d=106337

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
John White made changes - 24/Sep/08 08:58 PM
Field Original Value New Value
Affects Version/s 1.9.2 [ 10280 ]
Eloy Lafuente (stronk7) made changes - 25/Sep/08 01:38 AM
Fix Version/s 1.9.3 [ 10290 ]
Resolution Fixed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]
Petr Skoda made changes - 08/Oct/08 05:27 AM
Status Resolved [ 5 ] Closed [ 6 ]
QA Assignee skodak