return nl_br(h(preg_replace('~^(\\[[^]]*])+~m', '', $connection->error)));
}
- function exact_value($val) {
- return q($val);
- }
-
function create_database($db, $collation) {
return queries("CREATE DATABASE " . idf_escape($db) . (eregi('^[a-z0-9_]+$', $collation) ? " COLLATE $collation" : ""));
}
}
}
- /** Return expression for binary comparison
- * @param string
- * @return string
- */
- function exact_value($val) {
- return q($val) . " COLLATE utf8_bin";
- }
-
/** Create database
* @param string
* @param string
$return = "UNHEX($return)";
}
if ($field["type"] == "bit") {
- return "CONV($return, 2, 10) + 0";
+ $return = "CONV($return, 2, 10) + 0";
}
if (ereg("geometry|point|linestring|polygon", $field["type"])) {
$return = "GeomFromText($return)";
return h($connection->error); //! highlight sqltext from offset
}
- function exact_value($val) {
- return q($val);
- }
-
function explain($connection, $query) {
$connection->query("EXPLAIN PLAN FOR $query");
return $connection->query("SELECT * FROM plan_table");
return nl_br($return);
}
- function exact_value($val) {
- return q($val);
- }
-
function create_database($db, $collation) {
return queries("CREATE DATABASE " . idf_escape($db) . ($collation ? " ENCODING " . idf_escape($collation) : ""));
}
return h($connection->error);
}
- function exact_value($val) {
- return q($val);
- }
-
function check_sqlite_name($name) {
// avoid creating PHP files on unsecured servers
global $connection;
$function_pattern = '(^[\w\(]+' . str_replace("_", ".*", preg_quote(idf_escape("_"))) . '\)+$)'; //! columns looking like functions
foreach ((array) $where["where"] as $key => $val) {
$key = bracket_escape($key, 1); // 1 - back
- $return[] = (preg_match($function_pattern, $key) ? $key : idf_escape($key)) //! SQL injection
- . (($jush == "sql" && ereg('\\.', $val)) || $jush == "mssql" ? " LIKE " . exact_value(addcslashes($val, "%_\\")) : " = " . unconvert_field($fields[$key], exact_value($val))) // LIKE because of floats, but slow with ints, in MS SQL because of text
+ $column = (preg_match($function_pattern, $key) ? $key : idf_escape($key)); //! SQL injection
+ $return[] = $column
+ . (($jush == "sql" && ereg('^[0-9]*\\.[0-9]*$', $val)) || $jush == "mssql"
+ ? " LIKE " . q(addcslashes($val, "%_\\"))
+ : " = " . unconvert_field($fields[$key], q($val))
+ ) // LIKE because of floats but slow with ints, in MS SQL because of text
; //! enum and set
+ if ($jush == "sql" && ereg("[^ -@]", $val)) { // not just [a-z] to catch non-ASCII characters
+ $return[] = "$column = " . q($val) . " COLLATE utf8_bin";
+ }
}
foreach ((array) $where["null"] as $key) {
$return[] = idf_escape($key) . " IS NULL";
Don't check previous checkbox on added column in create table (bug #3614245)
Order table list by name
Verify UTF-8 encoding of CSV import
+MySQL: Speed up updating rows without numeric or UTF-8 primary key
PostgreSQL: Fix detecting oid column in PDO
PostgreSQL: Handle timestamp types (bug #3614086)
Add Korean translation
// find all used ids
$ids = array();
foreach ($rows as $row) {
- $ids[$row[$key]] = exact_value($row[$key]);
+ $ids[$row[$key]] = q($row[$key]);
}
// uses constant number of queries to get the descriptions, join would be complex, multiple queries would be slow
$descriptions = $this->_values[$table];
MySQL:
Data longer than max_allowed_packet can be sent by mysqli_stmt_send_long_data()
-COLLATE utf8_bin comparison doesn't use index with other than UTF-8 columns
SQLite:
Copy tables