Changeset: 4f32e7837d12 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=4f32e7837d12
Added Files:
        sql/backends/monet5/sql_decimal.mal
        sql/backends/monet5/sql_decimal.sh
Removed Files:
        sql/backends/monet5/sql_cast.mal
Branch: default
Log Message:

Decimal conversion script


diffs (truncated from 1349 to 300 lines):

diff --git a/sql/backends/monet5/sql_cast.mal b/sql/backends/monet5/sql_cast.mal
deleted file mode 100644
--- a/sql/backends/monet5/sql_cast.mal
+++ /dev/null
@@ -1,57 +0,0 @@
-@= mal_cast_dec2
-command calc.@1( s1:int, v:@2) :@1 
-address @2_dec2_@1
-comment "cast decimal(@2) to @1 and check for overflow";
-command calc.@1( s1:int, v:@2, d2:int, s2:int ) :@1 
-address @2_dec2dec_@1
-comment "cast decimal(@2) to decimal(@1) and check for overflow";
-
-command batcalc.@1( s1:int, v:bat[:oid,:@2]) :bat[:oid,:@1]
-address bat@2_dec2_@1
-comment "cast decimal(@2) to @1 and check for overflow";
-command batcalc.@1( s1:int, v:bat[:oid,:@2], d2:int, s2:int ) :bat[:oid,:@1] 
-address bat@2_dec2dec_@1
-comment "cast decimal(@2) to decimal(@1) and check for overflow";
-@
-@mal
-
-@= mal_cast2
-@:mal_cast_2dec(@1,@2)@
-@:mal_cast_dec2(@1,@2)@
-@
-@mal
-@:mal_cast2(bte,bte)@
-@:mal_cast2(bte,sht)@
-@:mal_cast2(bte,int)@
-@:mal_cast2(bte,wrd)@
-@:mal_cast2(bte,lng)@
-@:mal_cast2(sht,bte)@
-@:mal_cast2(sht,sht)@
-@:mal_cast2(sht,int)@
-@:mal_cast2(sht,wrd)@
-@:mal_cast2(sht,lng)@
-@:mal_cast2(int,bte)@
-@:mal_cast2(int,sht)@
-@:mal_cast2(int,int)@
-@:mal_cast2(int,wrd)@
-@:mal_cast2(int,lng)@
-@:mal_cast2(wrd,bte)@
-@:mal_cast2(wrd,sht)@
-@:mal_cast2(wrd,int)@
-@:mal_cast2(wrd,wrd)@
-@:mal_cast2(lng,bte)@
-@:mal_cast2(lng,sht)@
-@:mal_cast2(lng,int)@
-@:mal_cast2(lng,wrd)@
-@:mal_cast2(lng,lng)@
-@:mal_cast2(flt,bte)@
-@:mal_cast2(flt,sht)@
-@:mal_cast2(flt,int)@
-@:mal_cast2(flt,wrd)@
-@:mal_cast2(flt,lng)@
-@:mal_cast2(dbl,bte)@
-@:mal_cast2(dbl,sht)@
-@:mal_cast2(dbl,int)@
-@:mal_cast2(dbl,wrd)@
-@:mal_cast2(dbl,lng)@
-
diff --git a/sql/backends/monet5/sql_decimal.mal 
b/sql/backends/monet5/sql_decimal.mal
new file mode 100644
--- /dev/null
+++ b/sql/backends/monet5/sql_decimal.mal
@@ -0,0 +1,1209 @@
+# The contents of this file are subject to the MonetDB Public License
+# Version 1.1 (the "License"); you may not use this file except in
+# compliance with the License. You may obtain a copy of the License at
+# http://www.monetdb.org/Legal/MonetDBLicense
+#
+# Software distributed under the License is distributed on an "AS IS"
+# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+# License for the specific language governing rights and limitations
+# under the License.
+#
+# The Original Code is the MonetDB Database System.
+#
+# The Initial Developer of the Original Code is CWI.
+# Portions created by CWI are Copyright (C) 1997-July 2008 CWI.
+# Copyright August 2008-2013 MonetDB B.V.
+# All Rights Reserved.
+
+# This file was generated by using the script sql_decimal.sh.
+
+command calc.bte( v:flt, digits:int, scale:int ) :bte
+address flt_num2dec_bte
+comment "cast number to decimal(bte) and check for overflow";
+
+command batcalc.bte( v:bat[:oid,:flt], digits:int, scale:int ) :bat[:oid,:bte]
+address batflt_num2dec_bte
+comment "cast number to decimal(bte) and check for overflow";
+
+command calc.bte( v:dbl, digits:int, scale:int ) :bte
+address dbl_num2dec_bte
+comment "cast number to decimal(bte) and check for overflow";
+
+command batcalc.bte( v:bat[:oid,:dbl], digits:int, scale:int ) :bat[:oid,:bte]
+address batdbl_num2dec_bte
+comment "cast number to decimal(bte) and check for overflow";
+
+command calc.sht( v:flt, digits:int, scale:int ) :sht
+address flt_num2dec_sht
+comment "cast number to decimal(sht) and check for overflow";
+
+command batcalc.sht( v:bat[:oid,:flt], digits:int, scale:int ) :bat[:oid,:sht]
+address batflt_num2dec_sht
+comment "cast number to decimal(sht) and check for overflow";
+
+command calc.sht( v:dbl, digits:int, scale:int ) :sht
+address dbl_num2dec_sht
+comment "cast number to decimal(sht) and check for overflow";
+
+command batcalc.sht( v:bat[:oid,:dbl], digits:int, scale:int ) :bat[:oid,:sht]
+address batdbl_num2dec_sht
+comment "cast number to decimal(sht) and check for overflow";
+
+command calc.int( v:flt, digits:int, scale:int ) :int
+address flt_num2dec_int
+comment "cast number to decimal(int) and check for overflow";
+
+command batcalc.int( v:bat[:oid,:flt], digits:int, scale:int ) :bat[:oid,:int]
+address batflt_num2dec_int
+comment "cast number to decimal(int) and check for overflow";
+
+command calc.int( v:dbl, digits:int, scale:int ) :int
+address dbl_num2dec_int
+comment "cast number to decimal(int) and check for overflow";
+
+command batcalc.int( v:bat[:oid,:dbl], digits:int, scale:int ) :bat[:oid,:int]
+address batdbl_num2dec_int
+comment "cast number to decimal(int) and check for overflow";
+
+command calc.wrd( v:flt, digits:int, scale:int ) :wrd
+address flt_num2dec_wrd
+comment "cast number to decimal(wrd) and check for overflow";
+
+command batcalc.wrd( v:bat[:oid,:flt], digits:int, scale:int ) :bat[:oid,:wrd]
+address batflt_num2dec_wrd
+comment "cast number to decimal(wrd) and check for overflow";
+
+command calc.wrd( v:dbl, digits:int, scale:int ) :wrd
+address dbl_num2dec_wrd
+comment "cast number to decimal(wrd) and check for overflow";
+
+command batcalc.wrd( v:bat[:oid,:dbl], digits:int, scale:int ) :bat[:oid,:wrd]
+address batdbl_num2dec_wrd
+comment "cast number to decimal(wrd) and check for overflow";
+
+command calc.lng( v:flt, digits:int, scale:int ) :lng
+address flt_num2dec_lng
+comment "cast number to decimal(lng) and check for overflow";
+
+command batcalc.lng( v:bat[:oid,:flt], digits:int, scale:int ) :bat[:oid,:lng]
+address batflt_num2dec_lng
+comment "cast number to decimal(lng) and check for overflow";
+
+command calc.lng( v:dbl, digits:int, scale:int ) :lng
+address dbl_num2dec_lng
+comment "cast number to decimal(lng) and check for overflow";
+
+command batcalc.lng( v:bat[:oid,:dbl], digits:int, scale:int ) :bat[:oid,:lng]
+address batdbl_num2dec_lng
+comment "cast number to decimal(lng) and check for overflow";
+
+command calc.flt( v:flt, digits:int, scale:int ) :flt
+address flt_num2dec_flt
+comment "cast number to decimal(flt) and check for overflow";
+
+command batcalc.flt( v:bat[:oid,:flt], digits:int, scale:int ) :bat[:oid,:flt]
+address batflt_num2dec_flt
+comment "cast number to decimal(flt) and check for overflow";
+
+command calc.flt( v:dbl, digits:int, scale:int ) :flt
+address dbl_num2dec_flt
+comment "cast number to decimal(flt) and check for overflow";
+
+command batcalc.flt( v:bat[:oid,:dbl], digits:int, scale:int ) :bat[:oid,:flt]
+address batdbl_num2dec_flt
+comment "cast number to decimal(flt) and check for overflow";
+
+command calc.dbl( v:flt, digits:int, scale:int ) :dbl
+address flt_num2dec_dbl
+comment "cast number to decimal(dbl) and check for overflow";
+
+command batcalc.dbl( v:bat[:oid,:flt], digits:int, scale:int ) :bat[:oid,:dbl]
+address batflt_num2dec_dbl
+comment "cast number to decimal(dbl) and check for overflow";
+
+command calc.dbl( v:dbl, digits:int, scale:int ) :dbl
+address dbl_num2dec_dbl
+comment "cast number to decimal(dbl) and check for overflow";
+
+command batcalc.dbl( v:bat[:oid,:dbl], digits:int, scale:int ) :bat[:oid,:dbl]
+address batdbl_num2dec_dbl
+comment "cast number to decimal(dbl) and check for overflow";
+
+command calc.bte( v:bte, digits:int, scale:int ) :bte
+address bte_num2dec_bte
+comment "cast number to decimal(bte) and check for overflow";
+
+command batcalc.bte( v:bat[:oid,:bte], digits:int, scale:int ) :bat[:oid,:bte]
+address batbte_num2dec_bte
+comment "cast number to decimal(bte) and check for overflow";
+
+command calc.bte( s1:int, v:bte) :bte 
+address bte_dec2_bte
+comment "cast decimal(bte) to bte and check for overflow";
+command calc.bte( s1:int, v:bte, d2:int, s2:int ) :bte 
+address bte_dec2dec_bte
+comment "cast decimal(bte) to decimal(bte) and check for overflow";
+
+command batcalc.bte( s1:int, v:bat[:oid,:bte]) :bat[:oid,:bte]
+address batbte_dec2_bte
+comment "cast decimal(bte) to bte and check for overflow";
+command batcalc.bte( s1:int, v:bat[:oid,:bte], d2:int, s2:int ) 
:bat[:oid,:bte] 
+address batbte_dec2dec_bte
+comment "cast decimal(bte) to decimal(bte) and check for overflow";
+
+command calc.bte( v:sht, digits:int, scale:int ) :bte
+address sht_num2dec_bte
+comment "cast number to decimal(bte) and check for overflow";
+
+command batcalc.bte( v:bat[:oid,:sht], digits:int, scale:int ) :bat[:oid,:bte]
+address batsht_num2dec_bte
+comment "cast number to decimal(bte) and check for overflow";
+
+command calc.bte( s1:int, v:sht) :bte 
+address sht_dec2_bte
+comment "cast decimal(sht) to bte and check for overflow";
+command calc.bte( s1:int, v:sht, d2:int, s2:int ) :bte 
+address sht_dec2dec_bte
+comment "cast decimal(sht) to decimal(bte) and check for overflow";
+
+command batcalc.bte( s1:int, v:bat[:oid,:sht]) :bat[:oid,:bte]
+address batsht_dec2_bte
+comment "cast decimal(sht) to bte and check for overflow";
+command batcalc.bte( s1:int, v:bat[:oid,:sht], d2:int, s2:int ) 
:bat[:oid,:bte] 
+address batsht_dec2dec_bte
+comment "cast decimal(sht) to decimal(bte) and check for overflow";
+
+command calc.bte( v:int, digits:int, scale:int ) :bte
+address int_num2dec_bte
+comment "cast number to decimal(bte) and check for overflow";
+
+command batcalc.bte( v:bat[:oid,:int], digits:int, scale:int ) :bat[:oid,:bte]
+address batint_num2dec_bte
+comment "cast number to decimal(bte) and check for overflow";
+
+command calc.bte( s1:int, v:int) :bte 
+address int_dec2_bte
+comment "cast decimal(int) to bte and check for overflow";
+command calc.bte( s1:int, v:int, d2:int, s2:int ) :bte 
+address int_dec2dec_bte
+comment "cast decimal(int) to decimal(bte) and check for overflow";
+
+command batcalc.bte( s1:int, v:bat[:oid,:int]) :bat[:oid,:bte]
+address batint_dec2_bte
+comment "cast decimal(int) to bte and check for overflow";
+command batcalc.bte( s1:int, v:bat[:oid,:int], d2:int, s2:int ) 
:bat[:oid,:bte] 
+address batint_dec2dec_bte
+comment "cast decimal(int) to decimal(bte) and check for overflow";
+
+command calc.bte( v:wrd, digits:int, scale:int ) :bte
+address wrd_num2dec_bte
+comment "cast number to decimal(bte) and check for overflow";
+
+command batcalc.bte( v:bat[:oid,:wrd], digits:int, scale:int ) :bat[:oid,:bte]
+address batwrd_num2dec_bte
+comment "cast number to decimal(bte) and check for overflow";
+
+command calc.bte( s1:int, v:wrd) :bte 
+address wrd_dec2_bte
+comment "cast decimal(wrd) to bte and check for overflow";
+command calc.bte( s1:int, v:wrd, d2:int, s2:int ) :bte 
+address wrd_dec2dec_bte
+comment "cast decimal(wrd) to decimal(bte) and check for overflow";
+
+command batcalc.bte( s1:int, v:bat[:oid,:wrd]) :bat[:oid,:bte]
+address batwrd_dec2_bte
+comment "cast decimal(wrd) to bte and check for overflow";
+command batcalc.bte( s1:int, v:bat[:oid,:wrd], d2:int, s2:int ) 
:bat[:oid,:bte] 
+address batwrd_dec2dec_bte
+comment "cast decimal(wrd) to decimal(bte) and check for overflow";
+
+command calc.bte( v:lng, digits:int, scale:int ) :bte
+address lng_num2dec_bte
+comment "cast number to decimal(bte) and check for overflow";
+
+command batcalc.bte( v:bat[:oid,:lng], digits:int, scale:int ) :bat[:oid,:bte]
+address batlng_num2dec_bte
+comment "cast number to decimal(bte) and check for overflow";
+
+command calc.bte( s1:int, v:lng) :bte 
+address lng_dec2_bte
+comment "cast decimal(lng) to bte and check for overflow";
+command calc.bte( s1:int, v:lng, d2:int, s2:int ) :bte 
+address lng_dec2dec_bte
+comment "cast decimal(lng) to decimal(bte) and check for overflow";
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to