Cppdb: Bound double constant becomes string of integer
Brought to you by:
artyom-beilis
Double constant 1000000. passed to PostgreSQL reaches PostgreSQL as string '1000000':
const double E6=1000000.f; cppdb::result r=db_session << "SELECT amount/? FROM mytable" << E6;
PostgreSQL log:
Parameter:$1 = '1000000'
As a result, when amount is small, the selected result always becomes 0 rather than decimal like 0.01.
Anonymous