$row["auto_increment"] = $row['attidentity'] || preg_match('~^nextval\(~i', $row["default"]);
$row["privileges"] = array("insert" => 1, "select" => 1, "update" => 1);
if (preg_match('~(.+)::[^,)]+(.*)~', $row["default"], $match)) {
- $row["default"] = ($match[1] == "NULL" ? null : (($match[1][0] == "'" ? idf_unescape($match[1]) : $match[1]) . $match[2]));
+ $row["default"] = ($match[1] == "NULL" ? null : idf_unescape($match[1]) . $match[2]);
}
$return[$row["field"]] = $row;
}
AND contype = 'f'::char
ORDER BY conkey, conname") as $row) {
if (preg_match('~FOREIGN KEY\s*\((.+)\)\s*REFERENCES (.+)\((.+)\)(.*)$~iA', $row['definition'], $match)) {
- $row['source'] = array_map('trim', explode(',', $match[1]));
+ $row['source'] = array_map('idf_unescape', array_map('trim', explode(',', $match[1])));
if (preg_match('~^(("([^"]|"")+"|[^"]+)\.)?"?("([^"]|"")+"|[^"]+)$~', $match[2], $match2)) {
- $row['ns'] = str_replace('""', '"', preg_replace('~^"(.+)"$~', '\1', $match2[2]));
- $row['table'] = str_replace('""', '"', preg_replace('~^"(.+)"$~', '\1', $match2[4]));
+ $row['ns'] = idf_unescape($match2[2]);
+ $row['table'] = idf_unescape($match2[4]);
}
- $row['target'] = array_map('trim', explode(',', $match[3]));
+ $row['target'] = array_map('idf_unescape', array_map('trim', explode(',', $match[3])));
$row['on_delete'] = (preg_match("~ON DELETE ($on_actions)~", $match[4], $match2) ? $match2[1] : 'NO ACTION');
$row['on_update'] = (preg_match("~ON UPDATE ($on_actions)~", $match[4], $match2) ? $match2[1] : 'NO ACTION');
$return[$row['conname']] = $row;
}
$return = array();
foreach ($row as $key => $val) {
- $return[($key[0] == '"' ? idf_unescape($key) : $key)] = $val;
+ $return[idf_unescape($key)] = $val;
}
return $return;
}
return array(
"Timing" => strtoupper($match[1]),
"Event" => strtoupper($match[2]) . ($of ? " OF" : ""),
- "Of" => ($of[0] == '`' || $of[0] == '"' ? idf_unescape($of) : $of),
+ "Of" => idf_unescape($of),
"Trigger" => $name,
"Statement" => $match[4],
);
MariaDB: Do not treat sequences as views (PR #416)
PostgreSQL: Support UPDATE OF triggers (bug #789)
PostgreSQL: Support triggers with more events (OR)
+PostgreSQL: Fix parsing of foreign keys with non-ASCII column names
PostgreSQL < 10 PDO: Avoid displaying GENERATED ALWAYS BY IDENTITY everywhere (bug #785, regression from 4.7.9)
SQLite: Fix displayed types (bug #784, regression from 4.8.0)