Browse Source

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

Jan Janak 18 years ago
parent
commit
145a90df8a
3 changed files with 9 additions and 6 deletions
  1. 7 4
      modules/db_mysql/my_cmd.c
  2. 1 1
      modules/db_mysql/my_fld.c
  3. 1 1
      modules/db_mysql/my_fld.h

+ 7 - 4
modules/db_mysql/my_cmd.c

@@ -329,8 +329,8 @@ static inline int update_params(MYSQL_STMT* st, db_fld_t* params)
 
 
 		switch(params[i].type) {
 		switch(params[i].type) {
 		case DB_STR:
 		case DB_STR:
-			st->params[i].buffer = params[i].v.str.s;
-			fp->length = params[i].v.str.len;
+			st->params[i].buffer = params[i].v.lstr.s;
+			fp->length = params[i].v.lstr.len;
 			break;
 			break;
 
 
 		case DB_BLOB:
 		case DB_BLOB:
@@ -391,7 +391,7 @@ static inline int update_result(db_fld_t* result, MYSQL_STMT* st)
 
 
 		switch(result[i].type) {
 		switch(result[i].type) {
 		case DB_STR:
 		case DB_STR:
-			result[i].v.str.len = rp->length;
+			result[i].v.lstr.len = rp->length;
 			break;
 			break;
 
 
 		case DB_BLOB:
 		case DB_BLOB:
@@ -558,6 +558,9 @@ static int bind_params(MYSQL_STMT* st, db_fld_t* fld)
 	return -1;
 	return -1;
 }
 }
 
 
+/* FIXME: Add support for DB_NONE, in this case the function should determine
+ * the type of the column in the database and set the field type appropriately
+ */
 
 
 static int bind_result(MYSQL_STMT* st, db_fld_t* fld)
 static int bind_result(MYSQL_STMT* st, db_fld_t* fld)
 {
 {
@@ -612,7 +615,7 @@ static int bind_result(MYSQL_STMT* st, db_fld_t* fld)
 				return -1;
 				return -1;
 			}
 			}
 			result[i].buffer = f->buf.s;
 			result[i].buffer = f->buf.s;
-			fld[i].v.str.s = f->buf.s;
+			fld[i].v.lstr.s = f->buf.s;
 			result[i].buffer_length = STR_BUF_SIZE - 1;
 			result[i].buffer_length = STR_BUF_SIZE - 1;
 			break;
 			break;
 
 

+ 1 - 1
modules/db_mysql/my_fld.c

@@ -41,7 +41,7 @@ static void my_fld_free(db_fld_t* fld, struct my_fld* payload)
 }
 }
 
 
 
 
-int my_fld(db_fld_t* fld)
+int my_fld(db_fld_t* fld, char* table)
 {
 {
 	struct my_fld* res;
 	struct my_fld* res;
 
 

+ 1 - 1
modules/db_mysql/my_fld.h

@@ -42,6 +42,6 @@ struct my_fld {
 	str buf;
 	str buf;
 };
 };
 
 
-int my_fld(db_fld_t* fld);
+int my_fld(db_fld_t* fld, char* table);
 
 
 #endif /* _MY_FLD_H */
 #endif /* _MY_FLD_H */