[asterisk-commits] tilghman: trunk r98269 - /trunk/cdr/cdr_adaptive_odbc.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jan 11 12:35:31 CST 2008


Author: tilghman
Date: Fri Jan 11 12:35:30 2008
New Revision: 98269

URL: http://svn.digium.com/view/asterisk?view=rev&rev=98269
Log:
Port Nick Gorham's timestamp patch to adaptive_odbc, too

Modified:
    trunk/cdr/cdr_adaptive_odbc.c

Modified: trunk/cdr/cdr_adaptive_odbc.c
URL: http://svn.digium.com/view/asterisk/trunk/cdr/cdr_adaptive_odbc.c?view=diff&rev=98269&r1=98268&r2=98269
==============================================================================
--- trunk/cdr/cdr_adaptive_odbc.c (original)
+++ trunk/cdr/cdr_adaptive_odbc.c Fri Jan 11 12:35:30 2008
@@ -404,8 +404,8 @@
 							year += 2000;
 
 						lensql += snprintf(sql + lensql, sizesql - lensql, "%s,", entry->name);
-						LENGTHEN_BUF2(10);
-						lensql2 += snprintf(sql2 + lensql2, sizesql2 - lensql2, "'%04d-%02d-%02d',", year, month, day);
+						LENGTHEN_BUF2(17);
+						lensql2 += snprintf(sql2 + lensql2, sizesql2 - lensql2, "{ d '%04d-%02d-%02d' },", year, month, day);
 					}
 					break;
 				case SQL_TYPE_TIME:
@@ -419,8 +419,8 @@
 						}
 
 						lensql += snprintf(sql + lensql, sizesql - lensql, "%s,", entry->name);
-						LENGTHEN_BUF2(8);
-						lensql2 += snprintf(sql2 + lensql2, sizesql2 - lensql2, "'%02d:%02d:%02d',", hour, minute, second);
+						LENGTHEN_BUF2(15);
+						lensql2 += snprintf(sql2 + lensql2, sizesql2 - lensql2, "{ t '%02d:%02d:%02d' },", hour, minute, second);
 					}
 					break;
 				case SQL_TYPE_TIMESTAMP:
@@ -445,8 +445,8 @@
 							year += 2000;
 
 						lensql += snprintf(sql + lensql, sizesql - lensql, "%s,", entry->name);
-						LENGTHEN_BUF2(19);
-						lensql2 += snprintf(sql2 + lensql2, sizesql2 - lensql2, "'%04d-%02d-%02d %02d:%02d:%02d',", year, month, day, hour, minute, second);
+						LENGTHEN_BUF2(26);
+						lensql2 += snprintf(sql2 + lensql2, sizesql2 - lensql2, "{ ts '%04d-%02d-%02d %02d:%02d:%02d' },", year, month, day, hour, minute, second);
 					}
 					break;
 				case SQL_INTEGER:




More information about the asterisk-commits mailing list