Changeset: bb7931160d93 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/bb7931160d93
Modified Files:
        clients/odbc/driver/ODBCQueries.h
Branch: Dec2023
Log Message:

Prevent sql processor to produce server msg: mul_int_bte_int: ERROR: 
22003!overflow in calculation 2147483647*4.
when computing the CHAR_OCTET_LENGTH.


diffs (13 lines):

diff --git a/clients/odbc/driver/ODBCQueries.h 
b/clients/odbc/driver/ODBCQueries.h
--- a/clients/odbc/driver/ODBCQueries.h
+++ b/clients/odbc/driver/ODBCQueries.h
@@ -302,7 +302,7 @@
 
 #define CHAR_OCTET_LENGTH(t)                                                   
        \
                "cast(case when " #t ".type in 
('varchar','clob','char','json','url','xml') "   \
-                    "then 4 * " #t ".type_digits "                             
\
+                    "then 4 * cast(" #t ".type_digits as bigint) "             
        \
                     "when " #t ".type = 'blob' then " #t ".type_digits "       
\
-                    "else cast(null as integer) "                              
        \
+                    "else null "                                               
\
                "end as integer) as \"CHAR_OCTET_LENGTH\""
_______________________________________________
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org

Reply via email to