Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
mahara
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
mahara
mahara
Commits
cb1da444
Commit
cb1da444
authored
Jun 02, 2015
by
Robert Lyon
Committed by
Gerrit Code Review
Jun 02, 2015
Browse files
Options
Browse Files
Download
Plain Diff
Merge "DB execute functions without prepare values can go direct to _Execute()"
parents
7aedf73b
c22a8986
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
16 deletions
+16
-16
htdocs/lib/dml.php
htdocs/lib/dml.php
+16
-16
No files found.
htdocs/lib/dml.php
View file @
cb1da444
...
...
@@ -69,11 +69,11 @@ function db_is_utf8() {
throw
new
SQLException
(
'Database connection is not available '
);
}
if
(
is_mysql
())
{
$result
=
$db
->
Execute
(
"SHOW VARIABLES LIKE 'character_set_database'"
);
$result
=
$db
->
_
Execute
(
"SHOW VARIABLES LIKE 'character_set_database'"
);
return
$result
->
fields
[
'Value'
]
==
'utf8'
;
}
if
(
is_postgres
())
{
$result
=
$db
->
Execute
(
"SHOW SERVER_ENCODING"
);
$result
=
$db
->
_
Execute
(
"SHOW SERVER_ENCODING"
);
return
$result
->
fields
[
'server_encoding'
]
==
'UTF8'
;
}
return
false
;
...
...
@@ -86,7 +86,7 @@ function db_total_size() {
}
$dbname
=
db_quote
(
get_config
(
'dbname'
));
if
(
is_mysql
())
{
$result
=
$db
->
Execute
(
"
$result
=
$db
->
_
Execute
(
"
SELECT SUM( data_length + index_length ) AS dbsize
FROM information_schema.tables
WHERE table_schema =
$dbname
...
...
@@ -94,7 +94,7 @@ function db_total_size() {
return
$result
->
fields
[
'dbsize'
];
}
if
(
is_postgres
())
{
$result
=
$db
->
Execute
(
"SELECT * FROM pg_database_size(
$dbname
)"
);
$result
=
$db
->
_
Execute
(
"SELECT * FROM pg_database_size(
$dbname
)"
);
return
$result
->
fields
[
'pg_database_size'
];
}
return
false
;
...
...
@@ -106,7 +106,7 @@ function column_collation_is_default($table, $column) {
throw
new
SQLException
(
'Database connection is not available '
);
}
if
(
is_mysql
())
{
$result
=
$db
->
Execute
(
"SHOW VARIABLES LIKE 'collation_database'"
);
$result
=
$db
->
_
Execute
(
"SHOW VARIABLES LIKE 'collation_database'"
);
$defaultcollation
=
$result
->
fields
[
'Value'
];
$command
=
'SHOW FULL COLUMNS FROM '
.
db_table_name
(
$table
)
.
' WHERE field = ?'
;
...
...
@@ -143,7 +143,7 @@ function execute_sql($command, array $values=null) {
$result
=
$db
->
Execute
(
$stmt
,
$values
);
}
else
{
$result
=
$db
->
Execute
(
$command
);
$result
=
$db
->
_
Execute
(
$command
);
}
}
catch
(
ADODB_Exception
$e
)
{
...
...
@@ -472,7 +472,7 @@ function get_recordset_sql($sql, array $values=null, $limitfrom=null, $limitnum=
$stmt
=
$db
->
Prepare
(
$sql
);
$rs
=
$db
->
Execute
(
$stmt
,
$values
);
}
else
{
$rs
=
$db
->
Execute
(
$sql
);
$rs
=
$db
->
_
Execute
(
$sql
);
}
}
}
...
...
@@ -967,7 +967,7 @@ function delete_records_sql($sql, array $values=null) {
$stmt
=
$db
->
Prepare
(
$sql
);
$result
=
$db
->
Execute
(
$stmt
,
$values
);
}
else
{
$result
=
$db
->
Execute
(
$sql
);
$result
=
$db
->
_
Execute
(
$sql
);
}
}
catch
(
ADODB_Exception
$e
)
{
...
...
@@ -1074,7 +1074,7 @@ function insert_record($table, $dataobject, $primarykey=false, $returnpk=false)
// try to get the primary key based on id
try
{
$oidsql
=
'SELECT '
.
$primarykey
.
' FROM '
.
db_table_name
(
$table
)
.
' WHERE oid = '
.
$id
;
$rs
=
$db
->
Execute
(
$oidsql
);
$rs
=
$db
->
_
Execute
(
$oidsql
);
if
(
$rs
->
RecordCount
()
==
1
)
{
return
(
integer
)
$rs
->
fields
[
0
];
}
...
...
@@ -1357,7 +1357,7 @@ function where_values_prepared($value1=null, $value2=null, $value3=null, $value4
function
column_type
(
$table
,
$column
)
{
global
$db
;
if
(
!
$rs
=
$db
->
Execute
(
'SELECT '
.
$column
.
' FROM '
.
db_table_name
(
$table
)
.
' WHERE 1=2'
))
{
if
(
!
$rs
=
$db
->
_
Execute
(
'SELECT '
.
$column
.
' FROM '
.
db_table_name
(
$table
)
.
' WHERE 1=2'
))
{
return
false
;
}
...
...
@@ -1473,20 +1473,20 @@ function configure_dbconnection() {
$db
->
fnCacheExecute
=
'increment_perf_db_cached'
;
}
$db
->
Execute
(
"SET NAMES 'utf8'"
);
$db
->
_
Execute
(
"SET NAMES 'utf8'"
);
if
(
is_mysql
())
{
$db
->
Execute
(
"SET SQL_MODE='POSTGRESQL'"
);
$db
->
Execute
(
"SET CHARACTER SET utf8"
);
$db
->
Execute
(
"SET SQL_BIG_SELECTS=1"
);
$db
->
_
Execute
(
"SET SQL_MODE='POSTGRESQL'"
);
$db
->
_
Execute
(
"SET CHARACTER SET utf8"
);
$db
->
_
Execute
(
"SET SQL_BIG_SELECTS=1"
);
}
if
(
!
empty
(
$CFG
->
dbtimezone
))
{
if
(
is_postgres
())
{
$db
->
Execute
(
"SET SESSION TIME ZONE '
{
$CFG
->
dbtimezone
}
'"
);
$db
->
_
Execute
(
"SET SESSION TIME ZONE '
{
$CFG
->
dbtimezone
}
'"
);
}
if
(
is_mysql
())
{
$db
->
Execute
(
"SET time_zone='
{
$CFG
->
dbtimezone
}
'"
);
$db
->
_
Execute
(
"SET time_zone='
{
$CFG
->
dbtimezone
}
'"
);
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment