[asterisk-commits] tilghman: branch tilghman/adaptive_realtime r116342 - /team/tilghman/adaptive...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed May 14 12:06:22 CDT 2008


Author: tilghman
Date: Wed May 14 12:06:22 2008
New Revision: 116342

URL: http://svn.digium.com/view/asterisk?view=rev&rev=116342
Log:
Add a few more length checks

Modified:
    team/tilghman/adaptive_realtime/res/res_config_odbc.c

Modified: team/tilghman/adaptive_realtime/res/res_config_odbc.c
URL: http://svn.digium.com/view/asterisk/team/tilghman/adaptive_realtime/res/res_config_odbc.c?view=diff&rev=116342&r1=116341&r2=116342
==============================================================================
--- team/tilghman/adaptive_realtime/res/res_config_odbc.c (original)
+++ team/tilghman/adaptive_realtime/res/res_config_odbc.c Wed May 14 12:06:22 2008
@@ -906,7 +906,7 @@
 				case SQL_VARBINARY:
 				case SQL_LONGVARBINARY:
 				case SQL_GUID:
-					if ((type == RQ_INTEGER || type == RQ_CHAR) && col->size < size) {
+					if ((type == RQ_INTEGER && size > 10) || (type == RQ_CHAR && col->size < size)) {
 						warn_length(col, size);
 					} else if (type == RQ_DATE && col->size < 10) {
 						warn_length(col, 10);
@@ -935,6 +935,12 @@
 					if (type != RQ_INTEGER) {
 						warn_type(col, type);
 					}
+					if ((col->type == SQL_BIT && size > 1) ||
+						(col->type == SQL_TINYINT && size > 2) ||
+						(col->type == SQL_SMALLINT && size > 4) ||
+						(col->type == SQL_INTEGER && size > 10)) {
+						warn_length(col, size);
+					}
 					break;
 				case SQL_NUMERIC:
 				case SQL_DECIMAL:




More information about the asterisk-commits mailing list