Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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
4 adminer/drivers/mssql.inc.php
@@ -394,6 +394,10 @@ function auto_increment() {
394 394 return " IDENTITY";
395 395 }
396 396
  397 + function begin() {
  398 + return queries("BEGIN TRANSACTION");
  399 + }
  400 +
397 401 function insert_into($table, $set) {
398 402 return queries("INSERT INTO " . idf_escape($table) . ($set ? " (" . implode(", ", array_keys($set)) . ")\nVALUES (" . implode(", ", $set) . ")" : "DEFAULT VALUES"));
399 403 }
7 adminer/drivers/mysql.inc.php
@@ -680,6 +680,13 @@ function trigger_options() {
680 680 );
681 681 }
682 682
  683 + /** Begin transaction
  684 + * @return bool
  685 + */
  686 + function begin() {
  687 + return queries("BEGIN");
  688 + }
  689 +
683 690 /** Insert data into table
684 691 * @param string
685 692 * @param array
4 adminer/drivers/pgsql.inc.php
@@ -440,6 +440,10 @@ function trigger_options() {
440 440 );
441 441 }
442 442
  443 + function begin() {
  444 + return queries("BEGIN");
  445 + }
  446 +
443 447 function insert_into($table, $set) {
444 448 return queries("INSERT INTO " . idf_escape($table) . ($set ? " (" . implode(", ", array_keys($set)) . ")\nVALUES (" . implode(", ", $set) . ")" : "DEFAULT VALUES"));
445 449 }
4 adminer/drivers/sqlite.inc.php
@@ -474,6 +474,10 @@ function trigger_options() {
474 474 );
475 475 }
476 476
  477 + function begin() {
  478 + return queries("BEGIN");
  479 + }
  480 +
477 481 function insert_into($table, $set) {
478 482 return queries("INSERT INTO " . idf_escape($table) . ($set ? " (" . implode(", ", array_keys($set)) . ")\nVALUES (" . implode(", ", $set) . ")" : "DEFAULT VALUES"));
479 483 }
4 adminer/select.inc.php
@@ -126,7 +126,7 @@
126 126 $cols = array_keys($fields);
127 127 preg_match_all('~(?>"[^"]*"|[^"\\r\\n]+)+~', $file, $matches);
128 128 $affected = count($matches[0]);
129   - queries("START TRANSACTION");
  129 + begin();
130 130 $separator = ($_POST["separator"] == "csv" ? "," : ";");
131 131 foreach ($matches[0] as $key => $val) {
132 132 preg_match_all("~((\"[^\"]*\")+|[^$separator]*)$separator~", $val . $separator, $matches2);
@@ -313,7 +313,7 @@
313 313 $id = h("val[$unique_idf][" . bracket_escape($key) . "]");
314 314 $value = $_POST["val"][$unique_idf][bracket_escape($key)];
315 315 $h_value = h(isset($value) ? $value : $row[$key]);
316   - $editable = is_utf8($val) && !strpos($val, "<em>...</em>");
  316 + $editable = is_utf8($val) && !strpos($val, "<em>...</em>"); //! function results, not unique key
317 317 $text = ereg('text|blob', $field["type"]);
318 318 echo (($_GET["modify"] && $editable) || isset($value)
319 319 ? "<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]'>")

0 comments on commit d0c72ec

Please sign in to comment.
Something went wrong with that request. Please try again.