Changeset: 23cf48780a55 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=23cf48780a55
Modified Files:
        sql/test/pg_regress/Tests/float8.sql
        sql/test/pg_regress/postgresql2sql99.sh
Branch: default
Log Message:

Improved float8.sql tests. Could not generate the float8.stable.* files due to 
Mtest.py aborted (see bug 3594 & 3596)


diffs (63 lines):

diff --git a/sql/test/pg_regress/Tests/float8.sql 
b/sql/test/pg_regress/Tests/float8.sql
--- a/sql/test/pg_regress/Tests/float8.sql
+++ b/sql/test/pg_regress/Tests/float8.sql
@@ -96,24 +96,26 @@ select floor(f1) as floor_f1 from float8
 select sign(f1) as sign_f1 from float8_tbl f;
 
 -- square root 
-SELECT sqrt(double '64') AS eight;
-
-SELECT |/ double '64' AS eight;
+SELECT sqrt(cast('64' as double)) AS eight;
+SELECT |/ cast('64' as double) AS eight;
 
 SELECT '' AS three, f.f1, |/f.f1 AS sqrt_f1
    FROM FLOAT8_TBL f
    WHERE f.f1 > '0.0';
+SELECT '' AS three, f.f1, sqrt(f.f1) AS sqrt_f1
+   FROM FLOAT8_TBL f
+   WHERE f.f1 > '0.0';
 
 -- power
-SELECT power(double '144', double '0.5');
+SELECT power(cast('144' as double), cast('0.5' as double));
 
--- take exp of ln(f.f1) 
-SELECT '' AS three, f.f1, exp(ln(f.f1)) AS exp_ln_f1
+-- take exp of ln(f.f1)   (in MonetDB ln() is implemented as log())
+SELECT '' AS three, f.f1, exp(log(f.f1)) AS exp_ln_f1
    FROM FLOAT8_TBL f
    WHERE f.f1 > '0.0';
 
 -- cube root 
-SELECT ||/ double '27' AS three;
+SELECT ||/ cast('27' as double) AS three;
 
 SELECT '' AS five, f.f1, ||/f.f1 AS cbrt_f1 FROM FLOAT8_TBL f;
 
@@ -128,9 +130,9 @@ SELECT '' AS bad, f.f1 * '1e200' from FL
 
 SELECT '' AS bad, f.f1 ^ '1e200' from FLOAT8_TBL f;
 
-SELECT '' AS bad, ln(f.f1) from FLOAT8_TBL f where f.f1 = '0.0' ;
+SELECT '' AS bad, log(f.f1) from FLOAT8_TBL f where f.f1 = '0.0' ;
 
-SELECT '' AS bad, ln(f.f1) from FLOAT8_TBL f where f.f1 < '0.0' ;
+SELECT '' AS bad, log(f.f1) from FLOAT8_TBL f where f.f1 < '0.0' ;
 
 SELECT '' AS bad, exp(f.f1) from FLOAT8_TBL f;
 
diff --git a/sql/test/pg_regress/postgresql2sql99.sh 
b/sql/test/pg_regress/postgresql2sql99.sh
--- a/sql/test/pg_regress/postgresql2sql99.sh
+++ b/sql/test/pg_regress/postgresql2sql99.sh
@@ -92,6 +92,10 @@ sed -r \
        -e 's/TRIM(BOTH * FROM *)/TRIM(replace(\2,\1,' '))/Ig' \
        -e 's/\bcidr,/inet,/Ig' \
        -e 's/\bcidr(*)/cast(\1 as inet)/Ig' \
+       -e 's/\bdouble '64'/cast('64' as double)/Ig' \
+       -e 's/\bdouble '144'/cast('144' as double)/Ig' \
+       -e 's/\bdouble '0.5'/cast('0.5' as double)/Ig' \
+       -e 's/\bdouble '27'/cast('27' as double)/Ig' \
        -e 's/\bnumeric '10'/cast('10.0' as numeric(2,0))/Ig' \
        -e 's/\btext 'text'/cast('text' as text)/Ig' \
        -e 's/\bchar(20) 'characters'/cast('characters' as char(20))/Ig' \
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to