[CONCPP-98] sql::Properties crash Created: 2022-03-18  Updated: 2022-03-20  Resolved: 2022-03-20

Status: Closed
Project: MariaDB Connector/C++
Component/s: General
Affects Version/s: 1.0.1
Fix Version/s: 1.1.1

Type: Bug Priority: Minor
Reporter: ZTzTopia Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows 11 64Bit



 Description   

My program crashes after i call driver->connect using sql::Properties

   try {
        sql::Driver *driver = sql::mariadb::get_driver_instance();
        sql::SQLString url("jdbc:mariadb://127.0.0.1:3306/test");
        sql::Properties properties({{"user", "root"}, {"password", ""}});
        std::unique_ptr<sql::Connection> conn(driver->connect(url, properties));
        conn->close();
    }
    catch(sql::SQLException &e) {
        std::cerr << "Error Connecting to MariaDB Platform: " << e.what() << std::endl;
        return 1;
    }

but it doesn't crash if i use this code

   try {
        sql::Driver *driver = sql::mariadb::get_driver_instance();
        sql::SQLString url("jdbc:mariadb://127.0.0.1:3306/test");
        std::unique_ptr<sql::Connection> conn(driver->connect(url, "root", ""));
        conn->close();
    }
    catch(sql::SQLException &e) {
        std::cerr << "Error Connecting to MariaDB Platform: " << e.what() << std::endl;
        return 1;
    }



 Comments   
Comment by Lawrin Novitsky [ 2022-03-19 ]

You must be building Debug code for your test, and run it with our release binaries, which are RelWithDebInfo. If you build also RelWIthDebInfo or, probably, Release as well, the problem should go. The other solution is to build C/C++ Debug library from sources.

Comment by Lawrin Novitsky [ 2022-03-20 ]

The problem is fixed in 1.1, and for 1.0 it's known issue with existing workaround

Generated at Thu Feb 08 03:08:19 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.