]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Don't warn on floats and timestamps
authorTilghman Lesher <tilghman@meg.abyt.es>
Wed, 1 Sep 2010 18:13:35 +0000 (18:13 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Wed, 1 Sep 2010 18:13:35 +0000 (18:13 +0000)
(closes issue #17082)
Reported by: coolmig

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.2@284472 65c4cc65-6c06-0410-ace0-fbb531ad65f3

res/res_config_pgsql.c

index e58f8adb5fbec8a457cc2301e0884eb10d04fa67..38d38e345f7855ca9d631e13edd10cb68789358c 100644 (file)
@@ -1191,9 +1191,16 @@ static int require_pgsql(const char *database, const char *tablename, va_list ap
                                                        size, column->type);
                                                res = -1;
                                        }
-                               } else if (strncmp(column->type, "float", 5) == 0 && !ast_rq_is_int(type) && type != RQ_FLOAT) {
-                                       ast_log(LOG_WARNING, "Column %s cannot be a %s\n", column->name, column->type);
-                                       res = -1;
+                               } else if (strncmp(column->type, "float", 5) == 0) {
+                                       if (!ast_rq_is_int(type) && type != RQ_FLOAT) {
+                                               ast_log(LOG_WARNING, "Column %s cannot be a %s\n", column->name, column->type);
+                                               res = -1;
+                                       }
+                               } else if (strncmp(column->type, "timestamp", 9) == 0) {
+                                       if (type != RQ_DATETIME && type != RQ_DATE) {
+                                               ast_log(LOG_WARNING, "Column %s cannot be a %s\n", column->name, column->type);
+                                               res = -1;
+                                       }
                                } else { /* There are other types that no module implements yet */
                                        ast_log(LOG_WARNING, "Possibly unsupported column type '%s' on column '%s'\n", column->type, column->name);
                                        res = -1;