Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.9
-
Component/s: Database SQL/XMLDB
-
Labels:None
-
Database:Microsoft SQL
-
Affected Branches:MOODLE_19_STABLE
-
Fixed Branches:MOODLE_18_STABLE, MOODLE_19_STABLE, MOODLE_20_STABLE
Description
I don't know if this is specific to the mssql_n driver, but I can reproduce it with the following:
$enroldb = ADONewConnection($CFG->dbtype);
$enroldb->Connect($CFG->dbhost, $CFG->dbuser, $CFG->dbpass, $CFG->dbname, true);
$enroldb->SetFetchMode(ADODB_FETCH_ASSOC);
$enroldb->execute('set ansi_nulls on;
set ansi_warnings on;
set ansi_padding on;
set concat_null_yields_null on;');
// then examine the contents of
$enroldb->execute('select * from mdl_config')->getArray();
Fields that show up as being '' from tsql and MSSQL Server Management Express are NULL in the script.
This causes a problem upgrading to 1.9 because the admin page keeps on thinking that their are new configuration settings.
Attachments
Issue Links
| This issue has been marked as being related by: | ||||
| MDL-14725 | last m19 never dispose new settings page in MSSQL |
|
|
|
Hi Alan,
I remember that there was some bug in FreeTDS or PHP causing that. After a looking for it a bit, I've found this:
The FreeTDS bug tracker (I ignited!):
http://sourceforge.net/tracker/index.php?func=detail&aid=1547066&group_id=33106&atid=407806
The PHP bug that Freddy found and submitted to PHP bug tracker:
http://bugs.php.net/bug.php?id=39213
Note that the bugs is closed as fixed for PHP > 5.1.6
So it's beyond our capabilities to perform any change, in fact the mssql_n ADOdb driver hasn't any way to differentiate those false NULLs from the real ones, so the correct behaviour should be to re-compile PHP / FreeTDS, or to use one PHP version with the bug fixed or to use the FreeTDS alternative (ODBTP) that doesn't present this problem.
Closing this now, it would be great if you can test it with higher versions and confirm if it's working.