use to_char to allow comparing string to CLOB cloumns in oracle
This commit is contained in:
parent
b237d03791
commit
5ec13742b3
|
@ -174,7 +174,8 @@ class OC_App{
|
||||||
$apps=array('files');
|
$apps=array('files');
|
||||||
$sql = 'SELECT `appid` FROM `*PREFIX*appconfig`'
|
$sql = 'SELECT `appid` FROM `*PREFIX*appconfig`'
|
||||||
.' WHERE `configkey` = \'enabled\' AND `configvalue`=\'yes\'';
|
.' WHERE `configkey` = \'enabled\' AND `configvalue`=\'yes\'';
|
||||||
if (OC_Config::getValue( 'dbtype', 'sqlite' ) === 'oci') { //FIXME oracle hack
|
if (OC_Config::getValue( 'dbtype', 'sqlite' ) === 'oci') {
|
||||||
|
//FIXME oracle hack: need to explicitly cast CLOB to CHAR for comparison
|
||||||
$sql = 'SELECT `appid` FROM `*PREFIX*appconfig`'
|
$sql = 'SELECT `appid` FROM `*PREFIX*appconfig`'
|
||||||
.' WHERE `configkey` = \'enabled\' AND to_char(`configvalue`)=\'yes\'';
|
.' WHERE `configkey` = \'enabled\' AND to_char(`configvalue`)=\'yes\'';
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,7 +45,12 @@ class OC_Connector_Sabre_Locks extends Sabre_DAV_Locks_Backend_Abstract {
|
||||||
// but otherwise reading locks from SQLite Databases will return
|
// but otherwise reading locks from SQLite Databases will return
|
||||||
// nothing
|
// nothing
|
||||||
$query = 'SELECT * FROM `*PREFIX*locks`'
|
$query = 'SELECT * FROM `*PREFIX*locks`'
|
||||||
.' WHERE `userid` = ? AND (`created` + `timeout`) > '.time().' AND (( `uri` = ?)';
|
.' WHERE `userid` = ? AND (`created` + `timeout`) > '.time().' AND (( `uri` = ?)';
|
||||||
|
if (OC_Config::getValue( "dbtype") === 'oci') {
|
||||||
|
//FIXME oracle hack: need to explicitly cast CLOB to CHAR for comparison
|
||||||
|
$query = 'SELECT * FROM `*PREFIX*locks`'
|
||||||
|
.' WHERE `userid` = ? AND (`created` + `timeout`) > '.time().' AND (( to_char(`uri`) = ?)';
|
||||||
|
}
|
||||||
$params = array(OC_User::getUser(), $uri);
|
$params = array(OC_User::getUser(), $uri);
|
||||||
|
|
||||||
// We need to check locks for every part in the uri.
|
// We need to check locks for every part in the uri.
|
||||||
|
@ -60,15 +65,24 @@ class OC_Connector_Sabre_Locks extends Sabre_DAV_Locks_Backend_Abstract {
|
||||||
|
|
||||||
if ($currentPath) $currentPath.='/';
|
if ($currentPath) $currentPath.='/';
|
||||||
$currentPath.=$part;
|
$currentPath.=$part;
|
||||||
|
//FIXME oracle hack: need to explicitly cast CLOB to CHAR for comparison
|
||||||
$query.=' OR (`depth` != 0 AND `uri` = ?)';
|
if (OC_Config::getValue( "dbtype") === 'oci') {
|
||||||
|
$query.=' OR (`depth` != 0 AND to_char(`uri`) = ?)';
|
||||||
|
} else {
|
||||||
|
$query.=' OR (`depth` != 0 AND `uri` = ?)';
|
||||||
|
}
|
||||||
$params[] = $currentPath;
|
$params[] = $currentPath;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($returnChildLocks) {
|
if ($returnChildLocks) {
|
||||||
|
|
||||||
$query.=' OR (`uri` LIKE ?)';
|
//FIXME oracle hack: need to explicitly cast CLOB to CHAR for comparison
|
||||||
|
if (OC_Config::getValue( "dbtype") === 'oci') {
|
||||||
|
$query.=' OR (to_char(`uri`) LIKE ?)';
|
||||||
|
} else {
|
||||||
|
$query.=' OR (`uri` LIKE ?)';
|
||||||
|
}
|
||||||
$params[] = $uri . '/%';
|
$params[] = $uri . '/%';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue