Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Driver specific BEGIN

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1490 7c3ca157-0c34-0410-bff1-cbf682f78f5c
  • Loading branch information...
commit d0c72eca930a26750f50bc5a70a2600bc8d1cf96 1 parent 4681cc5
jakubvrana authored
View
4 adminer/drivers/mssql.inc.php
@@ -394,6 +394,10 @@ function auto_increment() {
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"));
}
View
7 adminer/drivers/mysql.inc.php
@@ -680,6 +680,13 @@ function trigger_options() {
);
}
+ /** Begin transaction
+ * @return bool
+ */
+ function begin() {
+ return queries("BEGIN");
+ }
+
/** Insert data into table
* @param string
* @param array
View
4 adminer/drivers/pgsql.inc.php
@@ -440,6 +440,10 @@ function trigger_options() {
);
}
+ 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"));
}
View
4 adminer/drivers/sqlite.inc.php
@@ -474,6 +474,10 @@ function trigger_options() {
);
}
+ 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"));
}
View
4 adminer/select.inc.php
@@ -126,7 +126,7 @@
$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 @@
$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, "<em>...</em>");
+ $editable = is_utf8($val) && !strpos($val, "<em>...</em>"); //! function results, not unique key
$text = ereg('text|blob', $field["type"]);
echo (($_GET["modify"] && $editable) || isset($value)
? "<td>" . ($text ? "<textarea name='$id' cols='30' rows='" . (substr_count($row[$key], "\n") + 1) . "'>$h_value</textarea>" : "<input name='$id' value='$h_value' size='$lengths[$key]'>")
Please sign in to comment.
Something went wrong with that request. Please try again.