Author: spadkins
Date: Mon Feb 9 11:20:26 2009
New Revision: 12494
Modified:
p5ee/trunk/App-Repository/t/DBI-select-ora.t
Log:
Changes
Modified: p5ee/trunk/App-Repository/t/DBI-select-ora.t
==============================================================================
--- p5ee/trunk/App-Repository/t/DBI-select-ora.t (original)
+++ p5ee/trunk/App-Repository/t/DBI-select-ora.t Mon Feb 9 11:20:26 2009
@@ -182,7 +182,7 @@
from test_person
where first_name = 'stephen'
and age = 37
- and birth_dt = '1962-01-01'
+ and birth_dt = to_date('1962-01-01','YYYY-MM-DD')
EOF
$sql = $rep->_mk_select_sql("test_person",{
"_order" => [ "first_name", "age", "birth_dt", ],
@@ -216,7 +216,7 @@
from test_person
where first_name in ('stephen','paul')
and age in (37,39)
- and birth_dt in ('1962-01-01','1963-12-31')
+ and birth_dt in
(to_date('1962-01-01','YYYY-MM-DD'),to_date('1963-12-31','YYYY-MM-DD'))
EOF
$sql = $rep->_mk_select_sql("test_person",{
"_order" => [ "first_name", "age", "birth_dt", ],
@@ -233,7 +233,7 @@
from test_person
where first_name = 'stephen'
and age = 37
- and birth_dt = '1962-01-01'
+ and birth_dt = to_date('1962-01-01','YYYY-MM-DD')
EOF
$sql = $rep->_mk_select_sql("test_person",{
"_order" => [ "first_name.eq", "age.eq", "birth_dt.eq", ],
@@ -250,7 +250,7 @@
from test_person
where first_name = 'stephen,paul'
and age in (37,39)
- and birth_dt = '1962-01-01,1963-12-31'
+ and birth_dt = to_date('1962-01-01,1963-12-31','YYYY-MM-DD')
EOF
$sql = $rep->_mk_select_sql("test_person",{
"_order" => [ "first_name.eq", "age", "birth_dt.eq", ],
@@ -275,7 +275,7 @@
from test_person
where first_name = 'stephen'
and age = 37
- and birth_dt = '1962-01-01'
+ and birth_dt = to_date('1962-01-01','YYYY-MM-DD')
EOF
$sql = $rep->_mk_select_sql("test_person",{
"_order" => [ "first_name.in", "age.in", "birth_dt.in", ],
@@ -292,7 +292,7 @@
from test_person
where first_name in ('stephen','paul')
and age in (37,39)
- and birth_dt in ('1962-01-01','1963-12-31')
+ and birth_dt in
(to_date('1962-01-01','YYYY-MM-DD'),to_date('1963-12-31','YYYY-MM-DD'))
EOF
$sql = $rep->_mk_select_sql("test_person",{
"_order" => [ "first_name.in", "age.in", "birth_dt.in", ],
@@ -309,7 +309,7 @@
from test_person
where first_name != 'stephen'
and age != 37
- and birth_dt != '1962-01-01'
+ and birth_dt != to_date('1962-01-01','YYYY-MM-DD')
EOF
$sql = $rep->_mk_select_sql("test_person",{
"_order" => [ "first_name.ne", "age.ne", "birth_dt.ne", ],
@@ -326,7 +326,7 @@
from test_person
where first_name >= 'stephen'
and age >= 37
- and birth_dt >= '1962-01-01'
+ and birth_dt >= to_date('1962-01-01','YYYY-MM-DD')
EOF
$sql = $rep->_mk_select_sql("test_person",{
"_order" => [ "first_name.ge", "age.ge", "birth_dt.ge", ],
@@ -343,7 +343,7 @@
from test_person
where first_name > 'stephen'
and age > 37
- and birth_dt > '1962-01-01'
+ and birth_dt > to_date('1962-01-01','YYYY-MM-DD')
EOF
$sql = $rep->_mk_select_sql("test_person",{
"_order" => [ "first_name.gt", "age.gt", "birth_dt.gt", ],
@@ -360,7 +360,7 @@
from test_person
where first_name <= 'stephen'
and age <= 37
- and birth_dt <= '1962-01-01'
+ and birth_dt <= to_date('1962-01-01','YYYY-MM-DD')
EOF
$sql = $rep->_mk_select_sql("test_person",{
"_order" => [ "first_name.le", "age.le", "birth_dt.le", ],
@@ -377,7 +377,7 @@
from test_person
where first_name < 'stephen'
and age < 37
- and birth_dt < '1962-01-01'
+ and birth_dt < to_date('1962-01-01','YYYY-MM-DD')
EOF
$sql = $rep->_mk_select_sql("test_person",{
"_order" => [ "first_name.lt", "age.lt", "birth_dt.lt", ],
@@ -394,7 +394,7 @@
from test_person
where first_name like '%s%'
and age like '%3%'
- and birth_dt like '%1962%'
+ and to_char(birth_dt,'YYYY-MM-DD') like '%1962%'
EOF
$sql = $rep->_mk_select_sql("test_person",{
"_order" => [ "first_name.contains", "age.contains",
"birth_dt.contains", ],
@@ -419,7 +419,7 @@
from test_person
where first_name not like '%s%'
and age not like '%3%'
- and birth_dt not like '%1962%'
+ and to_char(birth_dt,'YYYY-MM-DD') not like '%1962%'
EOF
$sql = $rep->_mk_select_sql("test_person",{
"_order" => [ "first_name.not_contains", "age.not_contains",
"birth_dt.not_contains", ],
@@ -444,7 +444,7 @@
from test_person
where first_name like '%s%e_'
and age like '%3'
- and birth_dt like '1962\\_%'
+ and to_char(birth_dt,'YYYY-MM-DD') like '1962\\_%'
EOF
$sql = $rep->_mk_select_sql("test_person",{
"_order" => [ "first_name.matches", "age.matches", "birth_dt.matches",
],
@@ -478,7 +478,7 @@
from test_person
where first_name not like '%s%'
and age not like '%3'
- and birth_dt not like '1962%'
+ and to_char(birth_dt,'YYYY-MM-DD') not like '1962%'
EOF
$sql = $rep->_mk_select_sql("test_person",{
"_order" => [ "first_name.not_matches", "age.not_matches",
"birth_dt.not_matches", ],
@@ -622,31 +622,12 @@
is($sql, $expect_sql, "_mk_select_sql(): is not null (by .not_in
'stephen,keith,NULL')");
&check_select($sql,0);
-if ($dbtype eq 'mysql') {
-$expect_sql = <<'EOF';
-select
- first_name
-from test_person
-where first_name like '%\'%'
- and birth_dt like '%\\\'_'
-EOF
-#print "[$expect_sql]\n";
-$sql = $rep->_mk_select_sql("test_person",{
- "_order" => [ "first_name.contains", "birth_dt.matches", ],
- "first_name.contains" => "'",
- "birth_dt.matches" => "*\\'?",
- },["first_name"]);
-is($sql, $expect_sql, "_mk_select_sql(): param.contains (proper quoting of '
and \\' required)");
-&check_select($sql,0);
-}
-
-if ($dbtype eq 'oracle') {
$expect_sql = <<'EOF';
select
first_name
from test_person
where first_name like '%''%'
- and birth_dt like '%\''_'
+ and to_char(birth_dt,'YYYY-MM-DD') like '%\''_'
EOF
#print "[$expect_sql]\n";
$sql = $rep->_mk_select_sql("test_person",{
@@ -656,7 +637,6 @@
},["first_name"]);
is($sql, $expect_sql, "_mk_select_sql(): param.contains (proper quoting of '
and \\' required)");
&check_select($sql,0);
-}
$expect_sql = <<EOF;
select