Hello!

Up to this day I knew every soci bug could be fixed.
But now I don't see any appropriate way to patch soci.

Example is attached.

I cannot modify sql query. Because it is passed from a plugin.
query: "select round( -111100237735.42999, 2 )";
Expected value: -111100237735.43

tcpdump shows string data "-111100237735.43".
But after that it is converted to double and precision is lost.

The only ugly way is to put method "std::string soci::row::get_raw_data() const";
which would return plain data received from MySQL server.

Any suggestions?


--
Best regards, Michael Evdokimov
Network Solutions, Moscow, Russia, Office: +7-495-7950677, Mobile: +7-963-6054013
Web: www.lanbilling.ru, www.lanbilling.tv, www.helpdesk2.ru
#include <iostream>
#include <soci/soci.h>
#include <soci/soci-mysql.h>
 
int main()
{
  soci::session db(soci::mysql, "user=billing password=billing dbname=ryazan2 host=127.0.0.1");
  soci::row r;
  db << "select round( -111100237735.42999, 2 )", into( r );
  std::cout << "result " << std::fixed << r.get<double>(0) << std::endl;
  std::cout << "expected -111100237735.43" << std::endl;
  return 0;
}

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-d2d
_______________________________________________
soci-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/soci-users

Reply via email to