Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-11810

adodb-mssql_n converts empty string to NULL

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.9
    • Fix Version/s: 1.8.4, 1.9, 2.0
    • 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.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    11/Jan/08