Uploaded image for project: 'phpBB'
  1. phpBB
  2. PHPBB-7678

Not updated part of sql_multi_insert().

XMLWordPrintable

      $db->sql_multi_insert currently contains this code, moved from $db->sql_build_array():

                      // If by accident the sql array is only one-dimensional we build a normal insert statement                if (!is_array($_sql_ary))                {                    $query = $this->sql_build_array('INSERT', $sql_ary);                    break;                } 

      The problem is that sql_multi_insert doesn't use $query, so this can't work. I have two proposals:

      1. Replacing this code with:

                      // If by accident the sql array is only one-dimensional we build a normal insert statement                if (!is_array($_sql_ary))                {                    $this->sql_query('INSERT INTO ' . $table . ' ' . $this->sql_build_array('INSERT', $sql_ary));                    return true;                } 

      2. Dropping this bad use of API and replacing code with:

                      // If by accident the sql array is only one-dimensional we _stop working_ - no accidents please!                if (!is_array($_sql_ary))                {                    trigger_error('$db->sql_multi_insert() was executed with one-dimensional $sql_ary.', E_USER_ERROR);                } 

      Maybe it's good idea to commit a 1st solution to 3.0 and 2nd to trunk?

            Acyd Burn Meik Sievertsen [X] (Inactive)
            LEW21 LEW21 [X] (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: