Author: wyoung
Date: Thu Nov  8 01:48:32 2007
New Revision: 1828

URL: http://svn.gna.org/viewcvs/mysqlpp?rev=1828&view=rev
Log:
SQLQueryParms can now accept a null value by assignment, so you can set
a query parameter to a null default.  Using this in resetdb, and new
description column in stock table is getting a SQL null when appropriate
instead of "NULL".

Modified:
    trunk/bmark.txt
    trunk/examples/resetdb.cpp
    trunk/lib/stadapter.h

Modified: trunk/bmark.txt
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/bmark.txt?rev=1828&r1=1827&r2=1828&view=diff
==============================================================================
--- trunk/bmark.txt (original)
+++ trunk/bmark.txt Thu Nov  8 01:48:32 2007
@@ -203,7 +203,7 @@
 ================ END custom2 OUTPUT ================
 
 ---------------- BEGIN custom3 OUTPUT ----------------
-Query: UPDATE stock SET item = 'Nuerenberger Bratwurst',num = 97,weight = 
1.5,price = 8.789999999999999,sdate = '2005-03-10',description = 'NULL' WHERE 
item = 'Nürnberger Brats'
+Query: UPDATE stock SET item = 'Nuerenberger Bratwurst',num = 97,weight = 
1.5,price = 8.789999999999999,sdate = '2005-03-10',description = NULL WHERE 
item = 'Nürnberger Brats'
 Query: select * from stock
 Records found: 5
 

Modified: trunk/examples/resetdb.cpp
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/examples/resetdb.cpp?rev=1828&r1=1827&r2=1828&view=diff
==============================================================================
--- trunk/examples/resetdb.cpp (original)
+++ trunk/examples/resetdb.cpp Thu Nov  8 01:48:32 2007
@@ -141,7 +141,7 @@
 
                // Set a default for template query parameters "table" and 
"desc".
                query.template_defaults["table"] = "stock";
-               query.template_defaults["desc"] = "NULL";
+               query.template_defaults["desc"] = mysqlpp::null;
 
                // Notice that we don't give a sixth parameter in these calls,
                // so the default value of "stock" is used.  Also notice that

Modified: trunk/lib/stadapter.h
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/stadapter.h?rev=1828&r1=1827&r2=1828&view=diff
==============================================================================
--- trunk/lib/stadapter.h (original)
+++ trunk/lib/stadapter.h Thu Nov  8 01:48:32 2007
@@ -182,6 +182,12 @@
        SQLTypeAdapter(const Null<Time>& t);
        SQLTypeAdapter& operator =(const Null<std::string>& str)
                        { return operator =(str.data); }
+       SQLTypeAdapter& operator =(const null_type& n)
+       { 
+               assign(null_str);
+               is_string_ = false;
+               is_processed_ = false;
+       }
 #endif // !defined(DOXYGEN_IGNORE)
 
 private:


_______________________________________________
Mysqlpp-commits mailing list
[email protected]
https://mail.gna.org/listinfo/mysqlpp-commits

Reply via email to