Browse code

- db_fld.v.str renamed to db_fld.v.lstr due to problems with g++

Jan Janak authored on 18/04/2007 13:08:45
Showing 3 changed files
... ...
@@ -329,8 +329,8 @@ static inline int update_params(MYSQL_STMT* st, db_fld_t* params)
329 329
 
330 330
 		switch(params[i].type) {
331 331
 		case DB_STR:
332
-			st->params[i].buffer = params[i].v.str.s;
333
-			fp->length = params[i].v.str.len;
332
+			st->params[i].buffer = params[i].v.lstr.s;
333
+			fp->length = params[i].v.lstr.len;
334 334
 			break;
335 335
 
336 336
 		case DB_BLOB:
... ...
@@ -391,7 +391,7 @@ static inline int update_result(db_fld_t* result, MYSQL_STMT* st)
391 391
 
392 392
 		switch(result[i].type) {
393 393
 		case DB_STR:
394
-			result[i].v.str.len = rp->length;
394
+			result[i].v.lstr.len = rp->length;
395 395
 			break;
396 396
 
397 397
 		case DB_BLOB:
... ...
@@ -558,6 +558,9 @@ static int bind_params(MYSQL_STMT* st, db_fld_t* fld)
558 558
 	return -1;
559 559
 }
560 560
 
561
+/* FIXME: Add support for DB_NONE, in this case the function should determine
562
+ * the type of the column in the database and set the field type appropriately
563
+ */
561 564
 
562 565
 static int bind_result(MYSQL_STMT* st, db_fld_t* fld)
563 566
 {
... ...
@@ -612,7 +615,7 @@ static int bind_result(MYSQL_STMT* st, db_fld_t* fld)
612 615
 				return -1;
613 616
 			}
614 617
 			result[i].buffer = f->buf.s;
615
-			fld[i].v.str.s = f->buf.s;
618
+			fld[i].v.lstr.s = f->buf.s;
616 619
 			result[i].buffer_length = STR_BUF_SIZE - 1;
617 620
 			break;
618 621
 
... ...
@@ -41,7 +41,7 @@ static void my_fld_free(db_fld_t* fld, struct my_fld* payload)
41 41
 }
42 42
 
43 43
 
44
-int my_fld(db_fld_t* fld)
44
+int my_fld(db_fld_t* fld, char* table)
45 45
 {
46 46
 	struct my_fld* res;
47 47
 
... ...
@@ -42,6 +42,6 @@ struct my_fld {
42 42
 	str buf;
43 43
 };
44 44
 
45
-int my_fld(db_fld_t* fld);
45
+int my_fld(db_fld_t* fld, char* table);
46 46
 
47 47
 #endif /* _MY_FLD_H */