mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-07 02:31:40 +09:00
issue 157 - Updated code so that no queries will execute when DB is not set and removed default escape char hack.
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9129 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
662b3f0915
commit
02c7587226
2 changed files with 4 additions and 8 deletions
|
|
@ -75,6 +75,8 @@
|
|||
|
||||
var $cache_file = 'files/cache/queries/'; ///< location of query cache
|
||||
|
||||
var $db_type; ///< stores database type: 'mysql','cubrid','mssql' etc. or 'db' when database is not yet set
|
||||
|
||||
/**
|
||||
* @brief returns instance of certain db type
|
||||
* @param[in] $db_type type of db
|
||||
|
|
@ -93,6 +95,7 @@
|
|||
// get a singletone instance of the database driver class
|
||||
require_once($class_file);
|
||||
$GLOBALS['__DB__'][$db_type] = call_user_func(array($class_name, 'create'));
|
||||
$GLOBALS['__DB__'][$db_type]->db_type = $db_type;
|
||||
}
|
||||
|
||||
return $GLOBALS['__DB__'][$db_type];
|
||||
|
|
@ -323,6 +326,7 @@
|
|||
**/
|
||||
function executeQuery($query_id, $args = NULL, $arg_columns = NULL, $database_type = 'master') {
|
||||
if(!$query_id) return new Object(-1, 'msg_invalid_queryid');
|
||||
if(!$this->db_type) return;
|
||||
|
||||
$this->actDBClassStart();
|
||||
|
||||
|
|
@ -601,12 +605,6 @@
|
|||
return "INSERT INTO $tableName \n $values";
|
||||
}
|
||||
|
||||
// HACK This is needed because on installation, the XmlQueryParer is used without any configured database
|
||||
// TODO Change this or make sure the query cache files created before db.config exists are deleted
|
||||
function getParser(){
|
||||
return new DBParser('`');
|
||||
}
|
||||
|
||||
function _getSlaveConnectionStringIndex() {
|
||||
$max = count($this->slave_db);
|
||||
$indx = rand(0, $max - 1);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue