Browse code

db_mysql: insert delayed implemented for DB API v1

Daniel-Constantin Mierla authored on 17/08/2011 22:33:51
Showing 3 changed files
... ...
@@ -113,6 +113,7 @@ int db_mysql_bind_api(db_func_t *dbb)
113 113
 	dbb->replace          = db_mysql_replace;
114 114
 	dbb->last_inserted_id = db_last_inserted_id;
115 115
 	dbb->insert_update    = db_insert_update;
116
+	dbb->insert_delayed   = db_mysql_insert_delayed;
116 117
 
117 118
 	return 0;
118 119
 }
... ...
@@ -538,6 +538,21 @@ error:
538 538
 }
539 539
 
540 540
 
541
+/**
542
+ * Insert delayed a row into a specified table.
543
+ * \param _h structure representing database connection
544
+ * \param _k key names
545
+ * \param _v values of the keys
546
+ * \param _n number of key=value pairs
547
+ * \return zero on success, negative value on failure
548
+ */
549
+int db_mysql_insert_delayed(const db1_con_t* _h, const db_key_t* _k, const db_val_t* _v, const int _n)
550
+{
551
+	return db_do_insert_delayed(_h, _k, _v, _n, db_mysql_val2str,
552
+	db_mysql_submit_query);
553
+}
554
+
555
+
541 556
 /**
542 557
  * Store the name of table that will be used by subsequent database functions
543 558
  * \param _h database handle
... ...
@@ -568,4 +583,4 @@ int db_mysql_alloc_buffer(void)
568 583
         return -1;
569 584
     else
570 585
         return 0;
571
-}
572 586
\ No newline at end of file
587
+}
... ...
@@ -118,6 +118,13 @@ int db_insert_update(const db1_con_t* _h, const db_key_t* _k, const db_val_t* _v
118 118
 	const int _n);
119 119
 
120 120
 
121
+/*! \brief
122
+ * Insert a row into table
123
+ */
124
+int db_mysql_insert_delayed(const db1_con_t* _h, const db_key_t* _k,
125
+		const db_val_t* _v, const int _n);
126
+
127
+
121 128
 /*! \brief
122 129
  * Store name of table that will be used by
123 130
  * subsequent database functions