Browse Source

- revert commit in revision 3022
- this commit misses a variable assignment that causes an error
- even if this is fixed, then mysql don't like unquoted time values
on insertion
- prober quoting of the time should be done in val2str, but this
requires probably a interface change in time2str
- for this changes we're to late in the release process, error should be
changed in the db_berkeley module


git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@3041 689a6050-402a-0410-94f2-e92a70836424

Henning Westerholt 18 years ago
parent
commit
09d410b4c2
1 changed files with 5 additions and 0 deletions
  1. 5 0
      lib/srdb1/db_ut.c

+ 5 - 0
lib/srdb1/db_ut.c

@@ -165,6 +165,8 @@ inline int db_time2str(time_t _v, char* _s, int* _l)
 		return -1;
 	}
 
+	*_s++ = '\'';
+
 	/* Convert time_t structure to format accepted by the database */
 	t = localtime(&_v);
 	l = strftime(_s, *_l -1, "%Y-%m-%d %H:%M:%S", t);
@@ -176,7 +178,10 @@ inline int db_time2str(time_t _v, char* _s, int* _l)
 		_l = 0;
 		return -1;
 	}
+	*_l = l;
 
+	*(_s + l) = '\'';
+	*_l = l + 2;
 	return 0;
 }