diff --git a/adminer/drivers/mssql.inc.php b/adminer/drivers/mssql.inc.php index 2e9007b4..690e4f2d 100644 --- a/adminer/drivers/mssql.inc.php +++ b/adminer/drivers/mssql.inc.php @@ -394,6 +394,10 @@ WHERE OBJECT_NAME(indexes.object_id) = " . $connection2->quote($table) return " IDENTITY"; } + function begin() { + return queries("BEGIN TRANSACTION"); + } + function insert_into($table, $set) { return queries("INSERT INTO " . idf_escape($table) . ($set ? " (" . implode(", ", array_keys($set)) . ")\nVALUES (" . implode(", ", $set) . ")" : "DEFAULT VALUES")); } diff --git a/adminer/drivers/mysql.inc.php b/adminer/drivers/mysql.inc.php index e11bd75b..16962f20 100644 --- a/adminer/drivers/mysql.inc.php +++ b/adminer/drivers/mysql.inc.php @@ -680,6 +680,13 @@ if (!defined("DRIVER")) { ); } + /** Begin transaction + * @return bool + */ + function begin() { + return queries("BEGIN"); + } + /** Insert data into table * @param string * @param array diff --git a/adminer/drivers/pgsql.inc.php b/adminer/drivers/pgsql.inc.php index ae2c5adc..9ab53ea0 100644 --- a/adminer/drivers/pgsql.inc.php +++ b/adminer/drivers/pgsql.inc.php @@ -440,6 +440,10 @@ WHERE tc.constraint_type = 'FOREIGN KEY' AND tc.table_name = " . $connection->qu ); } + function begin() { + return queries("BEGIN"); + } + function insert_into($table, $set) { return queries("INSERT INTO " . idf_escape($table) . ($set ? " (" . implode(", ", array_keys($set)) . ")\nVALUES (" . implode(", ", $set) . ")" : "DEFAULT VALUES")); } diff --git a/adminer/drivers/sqlite.inc.php b/adminer/drivers/sqlite.inc.php index 5563912a..aa161c50 100644 --- a/adminer/drivers/sqlite.inc.php +++ b/adminer/drivers/sqlite.inc.php @@ -474,6 +474,10 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) { ); } + function begin() { + return queries("BEGIN"); + } + function insert_into($table, $set) { return queries("INSERT INTO " . idf_escape($table) . ($set ? " (" . implode(", ", array_keys($set)) . ")\nVALUES (" . implode(", ", $set) . ")" : "DEFAULT VALUES")); } diff --git a/adminer/select.inc.php b/adminer/select.inc.php index 8e0db84d..3c56bf06 100644 --- a/adminer/select.inc.php +++ b/adminer/select.inc.php @@ -126,7 +126,7 @@ if ($_POST && !$error) { $cols = array_keys($fields); preg_match_all('~(?>"[^"]*"|[^"\\r\\n]+)+~', $file, $matches); $affected = count($matches[0]); - queries("START TRANSACTION"); + begin(); $separator = ($_POST["separator"] == "csv" ? "," : ";"); foreach ($matches[0] as $key => $val) { preg_match_all("~((\"[^\"]*\")+|[^$separator]*)$separator~", $val . $separator, $matches2); @@ -313,7 +313,7 @@ if (!$columns) { $id = h("val[$unique_idf][" . bracket_escape($key) . "]"); $value = $_POST["val"][$unique_idf][bracket_escape($key)]; $h_value = h(isset($value) ? $value : $row[$key]); - $editable = is_utf8($val) && !strpos($val, "..."); + $editable = is_utf8($val) && !strpos($val, "..."); //! function results, not unique key $text = ereg('text|blob', $field["type"]); echo (($_GET["modify"] && $editable) || isset($value) ? "