Browse code

- add space in front of "order by" (reported by Ben Smithurst and Anca Vamanu) - dev version increased

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

Daniel-Constantin Mierla authored on 17/08/2007 11:28:20
Showing 3 changed files
... ...
@@ -305,7 +305,7 @@ int db_mysql_query(db_con_t* _h, db_key_t* _k, db_op_t* _op,
305 305
 		off += ret;
306 306
 	}
307 307
 	if (_o) {
308
-		ret = snprintf(sql_buf + off, SQL_BUF_LEN - off, "order by %s", _o);
308
+		ret = snprintf(sql_buf + off, SQL_BUF_LEN - off, " order by %s", _o);
309 309
 		if (ret < 0 || ret >= (SQL_BUF_LEN - off)) goto error;
310 310
 		off += ret;
311 311
 	}
... ...
@@ -803,7 +803,7 @@ int pg_query(db_con_t* _con, db_key_t* _k, db_op_t* _op,
803 803
 	}
804 804
 	if (_o) {
805 805
 		off += snprintf(_s + off, SQL_BUF_LEN - off,
806
-			"order by %s", _o);
806
+			" order by %s", _o);
807 807
 	}
808 808
 
809 809
 	LOG (L_DBG, "PG[pg_query]: %p %p %s\n", _con, _r, _s);
... ...
@@ -358,7 +358,7 @@ db_key_t _o, db_res_t** _r)
358 358
 	}
359 359
 	if (_o)
360 360
 	{
361
-		ret = snprintf(sql_buf + off, SQL_BUF_LEN - off, "order by %s", _o);
361
+		ret = snprintf(sql_buf + off, SQL_BUF_LEN - off, " order by %s", _o);
362 362
 		if (ret < 0 || ret >= (SQL_BUF_LEN - off)) goto error;
363 363
 		off += ret;
364 364
 	}