Thanks to alxivnov (https://github.com/vrana/adminer/pull/490).
return array();
}
+ function is_c_style_escapes() {
+ return true;
+ }
+
function show_status() {
return array();
}
return get_key_vals("SHOW VARIABLES");
}
+ /** Checks if C-style escapes are supported
+ * @return bool
+ */
+ function is_c_style_escapes() {
+ static $c_style = null;
+ if ($c_style === null) {
+ $variables = get_key_vals("SHOW VARIABLES LIKE 'sql_mode'");
+ $c_style = strpos($variables["sql_mode"], 'NO_BACKSLASH_ESCAPES') === false;
+ }
+ return $c_style;
+ }
+
/** Get process list
* @return array ($row)
*/
return get_key_vals('SELECT name, display_value FROM v$parameter');
}
+ function is_c_style_escapes() {
+ return true;
+ }
+
function process_list() {
return get_rows('SELECT sess.process AS "process", sess.username AS "user", sess.schemaname AS "schema", sess.status AS "status", sess.wait_class AS "wait_class", sess.seconds_in_wait AS "seconds_in_wait", sql.sql_text AS "sql_text", sess.machine AS "machine", sess.port AS "port"
FROM v$session sess LEFT OUTER JOIN v$sql sql
return get_key_vals("SHOW ALL");
}
+ function is_c_style_escapes() {
+ static $c_style = null;
+ if ($c_style === null) {
+ $vals = get_vals("SHOW standard_conforming_strings");
+ $c_style = $vals[0] == "off";
+ }
+ return $c_style;
+ }
+
function process_list() {
return get_rows("SELECT * FROM pg_stat_activity ORDER BY " . (min_version(9.2) ? "pid" : "procpid"));
}
return $return;
}
+ function is_c_style_escapes() {
+ return true;
+ }
+
function show_status() {
$return = array();
foreach (get_vals("PRAGMA compile_options") as $option) {
$offset = $pos + strlen($found);
if ($found && rtrim($found) != $delimiter) { // find matching quote or comment end
- while (preg_match('(' . ($found == '/*' ? '\*/' : ($found == '[' ? ']' : (preg_match('~^-- |^#~', $found) ? "\n" : preg_quote($found) . "|\\\\."))) . '|$)s', $query, $match, PREG_OFFSET_CAPTURE, $offset)) { //! respect sql_mode NO_BACKSLASH_ESCAPES
+ $c_style_escapes = is_c_style_escapes() || ($jush == "pgsql" && ($pos > 0 && strtolower($query[$pos - 1]) == "e"));
+
+ $pattern = ($found == '/*' ? '\*/'
+ : ($found == '[' ? ']'
+ : (preg_match('~^-- |^#~', $found) ? "\n"
+ : preg_quote($found) . ($c_style_escapes ? "|\\\\." : "")
+ )));
+
+ while (preg_match("($pattern|\$)s", $query, $match, PREG_OFFSET_CAPTURE, $offset)) {
$s = $match[0][0];
if (!$s && $fp && !feof($fp)) {
$query .= fread($fp, 1e5);