CONCPP-70 statement::addBatch test sporadically failed

The reason was, that filling of vector with executeBatch results was
done using undefined behavior - it was done using [] operator member
access for not existing members. The values were inserted correctly, but
the size of vector happened to not always be reported correctly.
Added similar test to preparedstatement.
Made clearBatch not to reset current set of parameters - that looks
like to be that jdbc specs expect.
Fixed other such cases of wrong vector use.
Made some to/from text conversion to use C locale.
This commit is contained in:
Lawrin Novitsky
2021-02-13 22:03:15 +01:00
parent 029bd01df6
commit be22353bc2
14 changed files with 184 additions and 50 deletions

View File

@ -20,13 +20,16 @@
#include <iostream>
#include <memory>
#include <regex>
#include <string>
#include <sstream>
#include <cmath>
#include "mariadb/conncpp.hpp"
int main(int argc, char** argv)
{
// Instantiate Driver
sql::Driver* driver = sql::mariadb::get_driver_instance();
// Instantiate Driver
sql::Driver* driver = sql::mariadb::get_driver_instance();
// Configure Connection
sql::SQLString url("jdbc:mariadb://localhost/test");