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

adodb-mssql_n converts empty string to NULL

XMLWordPrintable

    • Microsoft SQL
    • MOODLE_19_STABLE
    • MOODLE_18_STABLE, MOODLE_19_STABLE, MOODLE_20_STABLE

      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.

        1. freetds_dblib.c.patch
          0.8 kB
          Eloy Lafuente (stronk7)
        2. php_mssql.c.patch
          0.5 kB
          Eloy Lafuente (stronk7)
        3. test.php
          0.8 kB
          Eloy Lafuente (stronk7)

            stronk7 Eloy Lafuente (stronk7)
            trick Alan Trick
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.