Hi,
The type conversion operator to std::string in mysql_dt_base
(datetime.h) should be declared const. Otherwise it leads to
compilation bugs with SSQL's that have a field of Date type which is
also comparable, e.g. the following would fail:
sql_create_1(PriceData,
1,
0,
Date, date);
with a compilation error of something like:
g++ -c -g -I. -I/usr/include/mysql -I/usr/src/mysql++-1.7.32/lib
db-update.cpp
db-update.cpp: In function `int sql_compare_PriceData(const PriceData&,
const
PriceData&) [with mysqlpp::sql_dummy_type dummy = sql_dummy]':
db-update.cpp:108: instantiated from here
db-update.cpp:402: error: passing `const mysqlpp:

ate' as `this'
argument of `
mysqlpp::mysql_dt_base:

perator std::string()' discards qualifiers
db-update.cpp:402: error: passing `const mysqlpp:

ate' as `this'
argument of `
mysqlpp::mysql_dt_base:

perator std::string()' discards qualifiers
make: *** [db-update.o] Error 1
Cheers,
Wolfram
Patch (relative to version 1.7.35) follows:
--- datetime.h.old 2005-05-11 00:57:53.000000000 -0700
+++ datetime.h 2005-05-11 01:59:19.000000000 -0700
@@ -21,7 +21,7 @@
struct mysql_dt_base {
virtual std:

stream& out_stream(std:

stream&) const = 0;
- operator std::string ();
+ operator std::string () const;
};
/// \if INTERNAL
@@ -160,7 +160,7 @@
return d.out_stream(s);
}
-inline mysql_dt_base:

perator std::string()
+inline mysql_dt_base:

perator std::string() const
{
return stream2string<std::string>(*this);
}
--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw