]> git.joonet.de Git - adminer.git/commitdiff
Driver specific BEGIN
authorjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Fri, 23 Apr 2010 23:49:21 +0000 (23:49 +0000)
committerjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Fri, 23 Apr 2010 23:49:21 +0000 (23:49 +0000)
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1490 7c3ca157-0c34-0410-bff1-cbf682f78f5c

adminer/drivers/mssql.inc.php
adminer/drivers/mysql.inc.php
adminer/drivers/pgsql.inc.php
adminer/drivers/sqlite.inc.php
adminer/select.inc.php

index 2e9007b4a603dfe74d24a542d197b29968f96857..690e4f2dec6f01fbbee8a5e2f4c2100d2341b7a7 100644 (file)
@@ -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"));
        }
index e11bd75b2b4ac4013b29a2536475e11de888568c..16962f205b434eb9f5cb529ccdc7ce98609bd167 100644 (file)
@@ -680,6 +680,13 @@ if (!defined("DRIVER")) {
                );
        }
        
+       /** Begin transaction
+       * @return bool
+       */
+       function begin() {
+               return queries("BEGIN");
+       }
+       
        /** Insert data into table
        * @param string
        * @param array
index ae2c5adc13445b7a7a6c41779267930cfe0050bd..9ab53ea0a6533f6f294ca9b205364d27e48a29bb 100644 (file)
@@ -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"));
        }
index 5563912a49d0f7e3bfb6512b683f8230ff3b5207..aa161c50cac54785bf51ac4c028b88971a49f2b0 100644 (file)
@@ -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"));
        }
index 8e0db84d55881b34d0df5d40c733c9209d52612f..3c56bf062856c750f15ccc57ae1daf6e9267c972 100644 (file)
@@ -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, "<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]'>")