Esempio n. 1
0
             // and accordingly set error messages & insert_fail
             if (method_exists($transformation_plugin, 'isSuccess') && !$transformation_plugin->isSuccess()) {
                 $insert_fail = true;
                 $row_skipped = true;
                 $insert_errors[] = sprintf(__('Row: %1$s, Column: %2$s, Error: %3$s'), $rownumber, $column_name, $transformation_plugin->getError());
             }
         }
     }
     if ($file_to_insert->isError()) {
         $message .= $file_to_insert->getError();
     }
     // delete $file_to_insert temporary variable
     $file_to_insert->cleanUp();
     $current_value = PMA_getCurrentValueForDifferentTypes($possibly_uploaded_val, $key, $multi_edit_columns_type, $current_value, $multi_edit_auto_increment, $rownumber, $multi_edit_columns_name, $multi_edit_columns_null, $multi_edit_columns_null_prev, $is_insert, $using_key, $where_clause, $table);
     $current_value_as_an_array = PMA_getCurrentValueAsAnArrayForMultipleEdit($multi_edit_funcs, $multi_edit_salt, $gis_from_text_functions, $current_value, $gis_from_wkb_functions, $func_optional_param, $func_no_param, $key);
     list($query_values, $query_fields) = PMA_getQueryValuesForInsertAndUpdateInMultipleEdit($multi_edit_columns_name, $multi_edit_columns_null, $current_value, $multi_edit_columns_prev, $multi_edit_funcs, $is_insert, $query_values, $query_fields, $current_value_as_an_array, $value_sets, $key, $multi_edit_columns_null_prev);
     if (isset($multi_edit_columns_null[$key])) {
         $multi_edit_columns[$key] = null;
     }
 }
 //end of foreach
 // temporarily store rows not inserted
 // so that they can be populated again.
 if ($insert_fail) {
     $unsaved_values[$rownumber] = $multi_edit_columns;
 }
 if (!$insert_fail && count($query_values) > 0) {
     if ($is_insert) {
         $value_sets[] = implode(', ', $query_values);
     } else {
         // build update query
 /**
  * Test for PMA_getQueryValuesForInsertAndUpdateInMultipleEdit
  *
  * @return void
  */
 public function testGetQueryValuesForInsertAndUpdateInMultipleEdit()
 {
     $multi_edit_columns_name = array('fld');
     $result = PMA_getQueryValuesForInsertAndUpdateInMultipleEdit($multi_edit_columns_name, null, null, null, null, true, array(1), array(2), 'foo', array(), 0, null);
     $this->assertEquals(array(array(1, 'foo'), array(2, '`fld`')), $result);
     $result = PMA_getQueryValuesForInsertAndUpdateInMultipleEdit($multi_edit_columns_name, array(), null, null, null, false, array(1), array(2), 'foo', array(), 0, array('a'));
     $this->assertEquals(array(array(1, '`fld` = foo'), array(2)), $result);
     $result = PMA_getQueryValuesForInsertAndUpdateInMultipleEdit($multi_edit_columns_name, array('b'), "'`c`'", array('c'), array(null), false, array(1), array(2), 'foo', array(), 0, array('a'));
     $this->assertEquals(array(array(1), array(2)), $result);
     $result = PMA_getQueryValuesForInsertAndUpdateInMultipleEdit($multi_edit_columns_name, array('b'), "'`c`'", array('c'), array(3), false, array(1), array(2), 'foo', array(), 0, array(null));
     $this->assertEquals(array(array(1, '`fld` = foo'), array(2)), $result);
 }