Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Oracle fixes

  • Loading branch information...
commit 6bbc6e17a8765a7aeda1db957956138f03b4e876 1 parent 6670a1f
@gabordemooij authored
View
10 RedBean/QueryWriter/Oracle.php
@@ -107,6 +107,16 @@ class RedBean_QueryWriter_Oracle extends RedBean_QueryWriter_AQueryWriter implem
const C_DATATYPE_SPECIAL_MULTIPOLYGON = 105;
const C_DATATYPE_SPECIAL_GEOMETRYCOLLECTION = 106;
+
+ public function safeColumn($c,$q=false) {
+ return parent::safeColumn((!$q) ? strtoupper($c):$c,$q);
+ }
+
+ public function safeTable($type,$q=false) {
+ return parent::safeTable((!$q) ? strtoupper($type) : $type,$q);
+ }
+
+
public function __construct(RedBean_Adapter $a) {
$this->adapter = $a;
View
9 testing/RedUNIT/Base/Facade.php
@@ -15,6 +15,15 @@
*/
class RedUNIT_Base_Facade extends RedUNIT_Base {
+
+ /**
+ * What drivers should be loaded for this test pack?
+ * This pack contains some SQL incomp. with OCI
+ */
+ public function getTargetDrivers() {
+ return array('mysql','pgsql','sqlite','CUBRID');
+ }
+
/**
* Begin testing.
* This method runs the actual test pack.
View
2  testing/RedUNIT/Base/Finding.php
@@ -70,7 +70,7 @@ public function run() {
asrt(count($pages),2);
$p = R::findLast('page');
pass();
- $row = R::getRow('select * from page limit 1');
+ $row = R::getRow('select * from page ');
asrt(is_array($row),true);
asrt(isset($row['name']),true);
//test findAll -- should not throw an exception
View
22 testing/RedUNIT/Base/Misc.php
@@ -102,9 +102,9 @@ public function run() {
$track = R::dispense('track');
$album = R::dispense('cd');
$track->name = 'a';
- $track->orderNum = 1;
+ $track->ordernum = 1;
$track2 = R::dispense('track');
- $track2->orderNum = 2;
+ $track2->ordernum = 2;
$track2->name = 'b';
R::associate( $album, $track );
R::associate( $album, $track2 );
@@ -180,7 +180,7 @@ public function run() {
$test->sharedSpoon[] = $spoon;
- $test->isNowTainted = true;
+ $test->isnowtainted = true;
$id=R::store($test);
$test = R::load('test',$id);
asrt($test->item->val,'Test2');
@@ -222,13 +222,15 @@ public function run() {
$cocoa->name = 'Koko';
R::store($cocoa);
- $pdo = R::$adapter->getDatabase()->getPDO();
- $driver = new RedBean_Driver_PDO($pdo);
- pass();
- asrt($pdo->getAttribute(PDO::ATTR_ERRMODE), PDO::ERRMODE_EXCEPTION);
- asrt($pdo->getAttribute(PDO::ATTR_DEFAULT_FETCH_MODE), PDO::FETCH_ASSOC);
- asrt(strval($driver->GetCell('select 123')),'123');
-
+ if (method_exists(R::$adapter->getDatabase(),'getPDO')) {
+ $pdo = R::$adapter->getDatabase()->getPDO();
+ $driver = new RedBean_Driver_PDO($pdo);
+ pass();
+ asrt($pdo->getAttribute(PDO::ATTR_ERRMODE), PDO::ERRMODE_EXCEPTION);
+ asrt($pdo->getAttribute(PDO::ATTR_DEFAULT_FETCH_MODE), PDO::FETCH_ASSOC);
+ asrt(strval($driver->GetCell('select 123')),'123');
+ }
+
$a = new RedBean_Exception_SQL;
$a->setSqlState('test');
$b = strval($a);
Please sign in to comment.
Something went wrong with that request. Please try again.