Quantcast
Channel: MySQL Forums - Connector/C++
Viewing all 527 articles
Browse latest View live

Insert update blob value converting from char *object and int length (no replies)

$
0
0
Hi,

I am running mysql in C++ on Debian platform. I have a small serialized msgpack object about 200 bytes, to run a statement to insert update the blob field, the blob value is from a buffer in char *object, int length, is any data type I can wrap the char *object and int length for the blob messageobject?

insert into mymessagetable (id, messageobject, timestamp) value (1, convertToBlob(object, length), 1549104102)

Thank you.

system error 126 (no replies)

$
0
0
Hi,

I am getting below error when trying to click "Test" button in ODBC Data source configuration.

mysql server 5.7 installed and from mysql workbench I am able to access.
C++ connector code(checkout to 5.3 branch) taken from git hub.
Created VC++ project/solution by running by executing below command.
in Visual studio 2015 version 14 , build solution file.
copied all dll and lib files to system folder.

c:\mysql-connector-odbc>set MYSQL_DIR=c:\mysql-5.7.25-win32
c:\mysql-connector-odbc>cmake -G "Visual Studio 12 2013" .

Please help me to resolve this issue. Kindly contact me anytime for any information regarding this.

Thanks
Debi Prasad
8885351660

Exception: DELIMITER // (no replies)

$
0
0
I can run DELIMITER // in the mysql command line, but could not run it in the C++ statement, it got an Exception: DELIMITER // You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DELIMITER //'

What I could be missing?

Thank you.

MySQL Connector/C++ 1.1.1: Microsoft Visual Studio 2017 - Why doesnt it work ? (no replies)

$
0
0
Hello all, I have this code, that is supposed to connect to MySQL and get some basic information from it. I pushed the cart as far as I could, but when I try to build the program, it simply doesnt work.

I am using Visual Studio 2017.


Additional info:

The project is attempted to be build in Release mode, because it said so in manual. The folder mysqlx is in the same folder as the project MyTry.vcxproj.

I made sure that the MySQL database is set up correctly, it does work through command line.

This code is straight from the xdevapi manual, it was just snippet, so I added main function and hopefully correct namespace.

#include <iostream>
#include <mysqlx/xdevapi.h>

using namespace mysqlx;

int main()
{


// Connecting to MySQL and working with a Session

// Connect to a dedicated MySQL server using a connection URI
string url = "mysqlx://localhost:3306/test?user=MY_USER_NAME&password=MY_PASSWORD";
{
Session mySession(url);

// Get a list of all available schemas

list<Schema> schemaList = mySession.getSchemas();

std::cout << "Available schemas in this session:";

// Loop over all available schemas and print their name
for (Schema schema : schemaList) {
std::cout << schema.getName();
}


}

return 0;
}


Here is the steps, I have done so far.

1. Set up the MYSQL database properly.

In VS2017:
2. Configuration Properties - Release mode

3.
Configuration Properties -> C/C++ -> General -> Additional Include Directories -> and I put the parent dir of mysqlx.

4.Configuration Properties -> Linker -> General -> Additional Library Directories -> (and I include parent directory of mysqlx, which is concidently the project folder)

Now, when I try to build this project in Release mode. I will get these errors:

1>------ Build started: Project: MyTry, Configuration: Release x64 ------
1>mytry.cpp
1>c:\users\uzivatel\source\repos\mytry\mytry\mytry.cpp(22): error C2065: 'list': undeclared identifier
1>c:\users\uzivatel\source\repos\mytry\mytry\mytry.cpp(22): error C2275: 'mysqlx::Schema': illegal use of this type as an expression
1>c:\users\uzivatel\source\repos\mytry\mytry\mysqlx\xdevapi.h(143): note: see declaration of 'mysqlx::Schema'
1>c:\users\uzivatel\source\repos\mytry\mytry\mytry.cpp(22): error C2065: 'schemaList': undeclared identifier
1>c:\users\uzivatel\source\repos\mytry\mytry\mytry.cpp(27): error C2065: 'schemaList': undeclared identifier
1>c:\users\uzivatel\source\repos\mytry\mytry\mytry.cpp(27): error C3312: no callable 'begin' function found for type 'unknown-type'
1>c:\users\uzivatel\source\repos\mytry\mytry\mytry.cpp(27): error C3312: no callable 'end' function found for type 'unknown-type'
1>c:\users\uzivatel\source\repos\mytry\mytry\mytry.cpp(28): error C2065: 'schema': undeclared identifier
1>Done building project "MyTry.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

What am I doing wrong ? Thank you

xdevapi.h can't pass compile (no replies)

$
0
0
Today,i find my code can't pass compile,and my computer environment is mingw64(It's installed by msys2)+MySQL8.0.15+mysql-connector-c++-8.0.15-winx64.zip.
I copy the 'include' folder to C:\msys64\mingw64\include\mysql.And having the code as follows:
```c++
#include <iostream>
#include <mysql/mysqlx/xdevapi.h>

int msin(){
return 0;
}
```
Howerer,the code can't pass compile.The compile message as follows:
--------------------------------------
[ 50%] Building CXX object CMakeFiles/uhelloworld.dir/main.cpp.obj
[100%] Linking CXX executable uhelloworld.exe
CMakeFiles\uhelloworld.dir/objects.a(main.cpp.obj): In function `mysqlx::string::operator std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >() const':
C:/msys64/mingw64/include/mysql/mysqlx/devapi/common.h:115: undefined reference to `mysqlx::string::Impl::to_utf8[abi:cxx11](mysqlx::string const&)'
CMakeFiles\uhelloworld.dir/objects.a(main.cpp.obj): In function `mysqlx::Value::print(std::ostream&) const':
C:/msys64/mingw64/include/mysql/mysqlx/devapi/document.h:507: undefined reference to `mysqlx::common::Value::print(std::ostream&) const'
CMakeFiles\uhelloworld.dir/objects.a(main.cpp.obj):main.cpp:(.rdata$_ZTCN6mysqlx5ValueE0_NS_6common5ValueE[_ZTCN6mysqlx5ValueE0_NS_6common5ValueE]+0x20): undefined reference to `mysqlx::common::Value::print(std::ostream&) const'
CMakeFiles\uhelloworld.dir/objects.a(main.cpp.obj):main.cpp:(.rdata$.refptr._ZTVN6mysqlx5DbDocE[.refptr._ZTVN6mysqlx5DbDocE]+0x0): undefined reference to `vtable for mysqlx::DbDoc'
collect2.exe: error: ld returned 1 exit status
---------------------------------
I can't solve this problem through www.baidu.com and offical document.
Someone could help me.I'd appreciate with you.

VS2017: Compiler Errors of xdevapi.h header files (no replies)

$
0
0
I have into an issue upgrading the connector from version 1.0 in a legacy system of ours. Any code file that has:


#include <mysqlx/xdevapi.h>


Will result in the following compiler errors:


3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(81): error C2059: syntax error: 'string'
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(83): error C2143: syntax error: missing ';' before '}'
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(83): error C2238: unexpected token(s) preceding ';'
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(99): error C2065: 'Option_impl': undeclared identifier
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(99): error C2146: syntax error: missing ')' before identifier 'opt'
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(120): error C2059: syntax error: 'protected'
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(123): error C2065: 'Option_impl': undeclared identifier
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(123): error C2923: 'std::pair': 'Option_impl' is not a valid template type argument for parameter '_Ty1'
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(125): error C3203: 'pair': unspecialized class template can't be used as a template argument for template parameter '_Ty', expected a real type
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(131): error C2059: syntax error: 'public'
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(137): error C2065: 'Option_impl': undeclared identifier
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(137): error C2143: syntax error: missing ';' before 'const'
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(137): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(137): warning C4091: ' ': ignored on left of 'const int' when no variable is declared
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(138): error C2065: 'Option_impl': undeclared identifier
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(138): error C2143: syntax error: missing ';' before 'const'
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(138): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(138): warning C4091: ' ': ignored on left of 'const int' when no variable is declared
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(140): error C2270: 'has_option': modifiers not allowed on nonmember functions
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(140): error C2365: 'mysqlx::common::has_option': redefinition; previous definition was 'data variable'
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(137): note: see declaration of 'mysqlx::common::has_option'
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(141): error C2270: 'get': modifiers not allowed on nonmember functions
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(141): error C2365: 'mysqlx::common::get': redefinition; previous definition was 'data variable'
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(138): note: see declaration of 'mysqlx::common::get'
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(147): error C2270: 'begin': modifiers not allowed on nonmember functions
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(148): error C2065: 'm_data': undeclared identifier
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(152): error C2270: 'end': modifiers not allowed on nonmember functions
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(153): error C2065: 'm_data': undeclared identifier
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(161): error C2065: 'Option_impl': undeclared identifier
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(161): error C2182: 'erase': illegal use of type 'void'
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(162): error C2365: 'mysqlx::common::erase': redefinition; previous definition was 'data variable'
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(161): note: see declaration of 'mysqlx::common::erase'
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(199): error C2059: syntax error: 'protected'
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(214): error C2061: syntax error: identifier 'Option_impl'
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(228): error C2653: 'Settings_impl': is not a class or namespace name
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(228): error C2065: 'Option_impl': undeclared identifier
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(228): error C2146: syntax error: missing ')' before identifier 'opt'
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(229): error C2143: syntax error: missing ';' before '{'
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(229): error C2447: '{': missing function header (old-style formal list?)
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(246): error C2653: 'Settings_impl': is not a class or namespace name
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(246): error C2065: 'Client_option_impl': undeclared identifier
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(246): error C2146: syntax error: missing ')' before identifier 'opt'
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(247): error C2143: syntax error: missing ';' before '{'
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(247): error C2447: '{': missing function header (old-style formal list?)
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(260): error C2653: 'Settings_impl': is not a class or namespace name
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(260): error C2065: 'SSL_mode': undeclared identifier
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(260): error C2146: syntax error: missing ')' before identifier 'mode'
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(261): error C2143: syntax error: missing ';' before '{'
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(261): error C2447: '{': missing function header (old-style formal list?)
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(271): error C2653: 'Settings_impl': is not a class or namespace name
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(271): error C2065: 'Auth_method': undeclared identifier
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(271): error C2146: syntax error: missing ')' before identifier 'method'
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(272): error C2143: syntax error: missing ';' before '{'
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(272): error C2447: '{': missing function header (old-style formal list?)
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(287): error C2653: 'Settings_impl': is not a class or namespace name
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(287): error C2065: 'Option_impl': undeclared identifier
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(287): error C2146: syntax error: missing ')' before identifier 'opt'
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(288): error C2143: syntax error: missing ';' before '{'
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(288): error C2447: '{': missing function header (old-style formal list?)
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(304): error C2653: 'Settings_impl': is not a class or namespace name
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(304): error C2065: 'Client_option_impl': undeclared identifier
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(304): error C2146: syntax error: missing ')' before identifier 'opt'
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(305): error C2143: syntax error: missing ';' before '{'
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(305): error C2447: '{': missing function header (old-style formal list?)
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(318): error C2653: 'Settings_impl': is not a class or namespace name
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(318): error C2065: 'Option_impl': undeclared identifier
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(318): error C2146: syntax error: missing ')' before identifier 'opt'
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(319): error C2143: syntax error: missing ';' before '{'
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(319): error C2447: '{': missing function header (old-style formal list?)
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(328): error C2653: 'Settings_impl': is not a class or namespace name
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(328): error C2065: 'Client_option_impl': undeclared identifier
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(328): error C2146: syntax error: missing ')' before identifier 'opt'
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(329): error C2143: syntax error: missing ';' before '{'
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(329): error C2447: '{': missing function header (old-style formal list?)
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(334): error C2653: 'Settings_impl': is not a class or namespace name
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(334): error C2065: 'Option_impl': undeclared identifier
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(334): error C2146: syntax error: missing ')' before identifier 'opt'
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(335): error C2143: syntax error: missing ';' before '{'
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(335): error C2447: '{': missing function header (old-style formal list?)
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(340): error C2653: 'Settings_impl': is not a class or namespace name
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(340): error C2065: 'Client_option_impl': undeclared identifier
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(340): error C2146: syntax error: missing ')' before identifier 'opt'
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(341): error C2143: syntax error: missing ';' before '{'
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(341): error C2447: '{': missing function header (old-style formal list?)
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(351): error C2653: 'Settings_impl': is not a class or namespace name
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(351): error C2065: 'Option_impl': undeclared identifier
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(351): error C2146: syntax error: missing ')' before identifier 'opt'
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(352): error C2143: syntax error: missing ';' before '{'
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(352): error C2447: '{': missing function header (old-style formal list?)
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(392): error C2653: 'Settings_impl': is not a class or namespace name
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(392): error C2065: 'Client_option_impl': undeclared identifier
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(392): error C2146: syntax error: missing ')' before identifier 'opt'
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(393): error C2143: syntax error: missing ';' before '{'
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(393): error C2447: '{': missing function header (old-style formal list?)
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(398): error C2059: syntax error: '}'
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\common\settings.h(398): error C2143: syntax error: missing ';' before '}'
3>c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\assert.h(14): error C2143: syntax error: missing ';' before '{'
3>c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\assert.h(14): error C2447: '{': missing function header (old-style formal list?)
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\devapi\detail\settings.h(148): error C2061: syntax error: identifier 'Client_option_impl'
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\devapi\detail\settings.h(296): note: see reference to class template instantiation 'mysqlx::internal::Settings_detail<Traits>' being compiled
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\devapi\detail\settings.h(169): warning C4346: 'std::is_convertible<V,int>::value': dependent name is not a type
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\devapi\detail\settings.h(169): note: prefix with 'typename' to indicate a type
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\devapi\detail\settings.h(169): error C2061: syntax error: identifier 'Client_option_impl'
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\devapi\detail\settings.h(202): error C2061: syntax error: identifier 'Client_option_impl'
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\devapi\detail\settings.h(214): error C3646: 'int_to_client_option': unknown override specifier
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\devapi\detail\settings.h(214): error C2062: type 'int' unexpected
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\devapi\detail\settings.h(215): error C2334: unexpected token(s) preceding '{'; skipping apparent function body
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\devapi\settings.h(107): error C2059: syntax error: 'string'
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\devapi\settings.h(109): error C2143: syntax error: missing ';' before '}'
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\devapi\settings.h(116): error C2065: 'SessionOption': undeclared identifier
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\devapi\settings.h(116): error C2146: syntax error: missing ')' before identifier 'opt'
3>[PRIVATE]\thirdparty\mysql-connector-c++-8.0.15-winx64\include\mysqlx\devapi\settings.h(116): fatal error C1003: error count exceeds 100; stopping compilation



Does anyone know why this is occurring?

Linking errors when trying to compile connector (no replies)

$
0
0
Really need your help, I'm trying to update my old project using new version of mysqlx connector. Compiling it in debug mode. I'm using VS2015 64bit mysql-connector-c++-8.0.15-src.

following this doc.https://dev.mysql.com/doc/dev/connector-cpp/8.0/building.html. I run cmake with the following configuration

cmake -DWITH_SSL=C:\Program Files\OpenSSL -DBUILD_STATIC=yes -DCMAKE_INSTALL_PREFIX=E:\mysql_build -G "Visual Studio 14 2015 Win64" -DSTATIC_MSVCRT=yes

"cmake --build . --target install --config Debug"

here are my dependencies
Normaliz.lib ws2_32.lib Crypt32.lib Wldap32.lib libcurl_a_debug.lib libcrypto.lib libssl.lib User32.lib Gdi32.lib mysql_connector-mt.lib

but when I use this code

void DatabaseMysql::Connect() {

::mysqlx::Session sess("mysqlx://root:zaq123@localhost:13009");
}

I get linking errors + warnings
1>ScannerServer.obj : warning LNK4217: locally defined symbol ?print@Value@common@mysqlx@@MEBAXAEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z (protected: virtual void __cdecl mysqlx::common::Value::print(class std::basic_ostream<char,struct std::char_traits<char> > &)const ) imported in function "public: virtual void __cdecl mysqlx::Value::print(class std::basic_ostream<char,struct std::char_traits<char> > &)const " (?print@Value@mysqlx@@UEBAXAEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z)

1>ScannerServer.obj : warning LNK4217: locally defined symbol ??0Value@common@mysqlx@@QEAA@XZ (public: __cdecl mysqlx::common::Value::Value(void)) imported in function "public: __cdecl mysqlx::Value::Value(void)" (??0Value@mysqlx@@QEAA@XZ)
1>ScannerServer.obj : warning LNK4217: locally defined symbol ?get_type@Value@common@mysqlx@@QEBA?AW4Type@123@XZ (public: enum mysqlx::common::Value::Type __cdecl mysqlx::common::Value::get_type(void)const ) imported in function "public: enum mysqlx::Value::Type __cdecl mysqlx::Value::getType(void)const " (?getType@Value@mysqlx@@QEBA?AW4Type@12@XZ)

1>ScannerServer.obj : warning LNK4217: locally defined symbol ??1Value@common@mysqlx@@QEAA@XZ (public: __cdecl mysqlx::common::Value::~Value(void)) imported in function "int `public: __cdecl mysqlx::Value::Value(void)'::`1'::dtor$0" (?dtor$0@?0???0Value@mysqlx@@QEAA@XZ@4HA)
1>ScannerServer.obj : warning LNK4217: locally defined symbol ?set_from_uri@Settings_impl@common@mysqlx@@QEAAXAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z (public: void __cdecl mysqlx::common::Settings_impl::set_from_uri(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)) imported in function "public: __cdecl mysqlx::SessionSettings::SessionSettings(class mysqlx::string const &)" (??0SessionSettings@mysqlx@@QEAA@AEBVstring@1@@Z)
1>ScannerServer.obj : warning LNK4217: locally defined symbol ?to_utf8@Impl@string@mysqlx@@SA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBV23@@Z (public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl mysqlx::string::Impl::to_utf8(class mysqlx::string const &)) imported in function "public: __cdecl mysqlx::string::operator class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(void)const " (??Bstring@mysqlx@@QEBA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ)

1>ScannerServer.obj : warning LNK4217: locally defined symbol ?from_utf8@Impl@string@mysqlx@@SAXAEAV23@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z (public: static void __cdecl mysqlx::string::Impl::from_utf8(class mysqlx::string &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)) imported in function "public: __cdecl mysqlx::string::string(char const *)" (??0string@mysqlx@@QEAA@PEBD@Z)
1>ScannerServer.obj : warning LNK4217: locally defined symbol ??0Error@mysqlx@@QEAA@PEBD@Z (public: __cdecl mysqlx::Error::Error(char const *)) imported in function __catch$??$?0PEBD@Session@mysqlx@@QEAA@PEBD@Z$2
1>ScannerServer.obj : warning LNK4217: locally defined symbol ??0DbDoc@mysqlx@@QEAA@XZ (public: __cdecl mysqlx::DbDoc::DbDoc(void)) imported in function "public: __cdecl mysqlx::Value::Value(void)" (??0Value@mysqlx@@QEAA@XZ)
1>ScannerServer.obj : warning LNK4217: locally defined symbol ??1DbDoc@mysqlx@@QEAA@XZ (public: __cdecl mysqlx::DbDoc::~DbDoc(void)) imported in function "public: __cdecl mysqlx::Value::~Value(void)" (??1Value@mysqlx@@QEAA@XZ)
1>ScannerServer.obj : warning LNK4217: locally defined symbol ??0Session_detail@internal@mysqlx@@IEAA@AEAVSettings_impl@common@2@@Z (protected: __cdecl mysqlx::internal::Session_detail::Session_detail(class mysqlx::common::Settings_impl &)) imported in function "public: __cdecl mysqlx::Session::Session(class mysqlx::SessionSettings)" (??0Session@mysqlx@@QEAA@VSessionSettings@1@@Z)
1>ScannerServer.obj : warning LNK4217: locally defined symbol ??1Session_detail@internal@mysqlx@@MEAA@XZ (protected: virtual __cdecl mysqlx::internal::Session_detail::~Session_detail(void)) imported in function "public: virtual __cdecl mysqlx::Session::~Session(void)" (??1Session@mysqlx@@UEAA@XZ)

1>ScannerServer.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl mysqlx::common::Settings_impl::Settings_impl(void)" (__imp_??0Settings_impl@common@mysqlx@@QEAA@XZ) referenced in function "public: __cdecl mysqlx::internal::Settings_detail<struct mysqlx::internal::Settings_traits>::Settings_detail<struct mysqlx::internal::Settings_traits>(void)" (??0?$Settings_detail@USettings_traits@internal@mysqlx@@@internal@mysqlx@@QEAA@XZ)

1>ScannerServer.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl mysqlx::common::Settings_impl::~Settings_impl(void)" (__imp_??1Settings_impl@common@mysqlx@@QEAA@XZ) referenced in function "public: __cdecl mysqlx::internal::Settings_detail<struct mysqlx::internal::Settings_traits>::~Settings_detail<struct mysqlx::internal::Settings_traits>(void)" (??1?$Settings_detail@USettings_traits@internal@mysqlx@@@internal@mysqlx@@QEAA@XZ)

connector 8 Session exception (no replies)

$
0
0
I have setup the very basic program as follow in Visual Studio 2017. x64 compiles/links fine. The local debugger immediately produces a memory exception when trying to open a session. I tried this on 2 different win 10 machines - I am probably missing something very basic. Any further debugging ideas would be appreciated! Thans

#include <mysqlx/xdevapi.h>

using namespace mysqlx;

int main()
{
Session sess("localhost", 33060, "user", "password");
}

the exception happens at

template<typename...T>
Session(T...options)
try
: Session(SessionSettings(options...))
{}CATCH_AND_WRAP

Unhandled exception at 0x00007FFF88F1A388 in mysqltest.exe: Microsoft C++ exception: mysqlx::Error at memory location 0x00000050AA2FFBD8. occurred

Run Time error: CDK Error: Failed string conversion (1 reply)

$
0
0
I am trying to connect to MySql database I created at AWS RDS with the following simple code:

try {
using namespace ::mysqlx;

Session sess("fds-symbol-usage-log.c68mzlz3vy3c.us-west-2.rds.amazonaws.com", 3306, "sa", "Trade123!");
Schema db = sess.getSchema("fds_symbol_usage_log");
....


However, I got error CDK Error: Failed string conversion at the very 1st line.
I am using Visual Studio 2015 and Connector/C++ 8.0.16. I have tried both x86 and x64, same error.

Not sure what I have missed, please help.

Thanks.

Michael

MySQL Connector/C++ 8.0.16 has been released (no replies)

ResultSet->getString() (no replies)

$
0
0
why must use ResultSet->getString("theColumnName").c_str();
when use like cout<<rs->getString(),it occurs interruption.
why can't output the SQLString directly?

Access Results Set Columns When Multiple Instances Of Same Table Aliased (no replies)

$
0
0
DB noob here!

I am building a MySQL-driven data management system for inspection reports and associated data created on a production floor as subassemblies are built up. Any part number can be a parent assembly or a subassembly. When a part appears as a parent, there's one set of revision specs. When a part appears as a subassembly, there's a different set of revision specs. A unique part specification appears as a reference to manufacturer, part number, and revision level. For obvious reasons, I want to use a single table for all possible part numbers, rather than allowing the potential for the same part number to appear in either or both part or subassembly tables.

I have a great deal of the system working. I'm at a point where I'm listing out available inspection forms for the administrator or operator of an inspection station. This means summarizing the data from an inspection form and all the referenced tables into a single line of data in a list in the UI. I'm using C++ because C++ is the basis of the control code for final assembly equipment control software that integrates the subassemblies, and which has to access the same data base and merge the quality records from the subassembly stations into the master quality audit record for each final assembly. This means I can use the same libraries I develop for this terminal for the control systems -- a great labor savings.

In this code fragment, I build up the query that joins the inspection form record to the various dependent table data, execute it, and then load each results record's elements of interest into an element of a vector of structures ready to pass to my UI.

It's working. As you can see, the query ultimately references the table 00400_assemblynumbers twice -- once to retrieve the parent assembly part number, and once to retrieve the subassembly's part number. These are aliased.

I'm aware that I could use SQL to organize and concatenate the results into a single string, but I have to do some comparisons with the data that makes it more convenient to keep it organized into separate fields.

I found the rule that says "the alias' scope is limited to the sql squery".

I found a rule that says "If two or more columns of the result have the same field names, the last column will take precedence. To access the other column(s) of the same name, you must use the numeric index of the column or make an alias for the column. For aliased columns, you cannot access the contents with the original column name."

I tried the lines that are commented out. Clearly they violate both of the above.

I picked apart the results set to find the columns in which the two instances of the part number string appears. I hate hardwiring the column numbers in there, but, as I said, it works.

If I were to instead apply aliases to the relevant column names, how would I do that?

stmt = m_pconConnection->createStatement();

// let the data base do the work of tracking down the references
string strStatement = "SELECT * FROM 00510_inspectionforms ";
strStatement = strStatement + "INNER JOIN (00410_assemblyspecs ";
strStatement = strStatement + "INNER JOIN 00300_manufacturers ON 00410_assemblyspecs.mfrref = 00300_manufacturers.mfridx ";
strStatement = strStatement + "INNER JOIN 00400_assemblynumbers AS ASSYPARENT ON 00410_assemblyspecs.assyref = ASSYPARENT.assynumberidx ";
strStatement = strStatement + "INNER JOIN 00200_revs ON 00410_assemblyspecs.revref = 00200_revs.revidx) ";
strStatement = strStatement + "ON 00510_inspectionforms.parentassyref = 00410_assemblyspecs.assyspecidx ";
strStatement = strStatement + "INNER JOIN (00451_subassemblyspecs ";
strStatement = strStatement + "INNER JOIN 00400_assemblynumbers AS ASSYSUB ON 00451_subassemblyspecs.subassyref = ASSYSUB.assynumberidx ";
strStatement = strStatement + "INNER JOIN 00450_formrevisions ON 00451_subassemblyspecs.revref = 00450_formrevisions.revidx) ";
strStatement = strStatement + "ON 00510_inspectionforms.subassyspecref = 00451_subassemblyspecs.subassyspecidx ";
strStatement = strStatement + "INNER JOIN 00500_disposalinstrs ";
strStatement = strStatement + "ON 00510_inspectionforms.dispinstrref = 00500_disposalinstrs.dispinstridx ";

// make the query call
results = stmt->executeQuery(strStatement);

// traverse the results
while (results->next())
{
// a temp struct
AllFormData afdTemp;

// load it up
afdTemp.iFormIdx = results->getInt("formidx");
afdTemp.strMfr = results->getString("assymfr");
// afdTemp.strAssyNumber = results->getString("ASSYPARENT.assynumber");
afdTemp.strAssyNumber = results->getString(15);
afdTemp.strAssyRev = results->getString("revdesc");
// afdTemp.strSubAssyNumber = results->getString("ASSYSUB.assynumber");
afdTemp.strSubAssyNumber = results->getString(23);
afdTemp.strSubAssyRev = results->getString("revlevel");
afdTemp.bBulkInsp = (BOOL)results->getInt("bulkinspform");
afdTemp.bMilSpec = (BOOL)results->getInt("milspec");
afdTemp.strDisposalInstructions = results->getString("dispsummary");

Automatic Casting to Types not working (no replies)

$
0
0
Hi,

I recently upgraded my MySQL Connector C++ to v8.0.16 which lead to problem occurring during the compile of my project.

All the errors are from casting the "mysql::abi2::r0::Value" to different types.
For example, I have this code inside one of my functions:

std::string s;
sql::Row res;

... Fetching from database ...

s = row[0]; // Here is the error

The error I'm having is:

no suitable user-defined conversion from "mysqlx::abi2::r0::Value" to "std::string" exists

But if I use casting it works:

s = (std::string)row[0]; // No error here

In the previous version of MySQL Connector C++ I didn't have this problem.

My question is this is a problem with MySQL Connector or it's a problem with my project?

Thanks in advance!

executereader error (no replies)

$
0
0
hi, I have a vb program that wants to retrieve data from MySQL dbase.

this code is working fine :

Dim vDATE As String

vDATE = mDATE.ToString("yyyy/MM/dd", System.Globalization.CultureInfo.InvariantCulture)
Dim connstring As String = "server=xxx.xxx.x.xx;database=dbname;uid=idko;Pwd=passko"
Using con As New MySqlConnection(connstring)
con.Open()
Dim query As String = "SELECT issue_date, inc_date, exp_date, total FROM table_name WHERE COC_DATE = @DATE "
Dim MYSQLCMD As New MySqlCommand(query, con)
MYSQLCMD.Parameters.AddWithValue("@DATE", vDATE)
Dim reader As MySqlDataReader = MYSQLCMD.ExecuteReader
While reader.Read
MessageBox.Show(reader.GetString(0) & vbCr & reader.GetString(1) & vbCr & reader.GetString(2) & vbCr & reader.GetString(3))
End While
End Using

but the code below give me an error that says "A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond"

Dim vDATE As String

vDATE = mDATE.ToString("yyyy/MM/dd", System.Globalization.CultureInfo.InvariantCulture)
Dim connstring As String = "server=xxx.xxx.x.xx;database=dbname;uid=idko;Pwd=passko"
Using con As New MySqlConnection(connstring)
con.Open()
Dim query As String = "SELECT ref_no,name, address,zipcode FROM table_name WHERE COC_DATE = @DATE "
Dim MYSQLCMD As New MySqlCommand(query, con)
MYSQLCMD.Parameters.AddWithValue("@DATE", vDATE)
Dim reader As MySqlDataReader = MYSQLCMD.ExecuteReader
While reader.Read
MessageBox.Show(reader.GetString(0) & vbCr & reader.GetString(1) & vbCr & reader.GetString(2) & vbCr & reader.GetString(3))
End While
End Using

any help would be greatly appreciated.

thank you.

"Install Directory" - can you please be more specific? (1 reply)

$
0
0
I'm trying to build the Connector/C++ on Ubuntu 18.04 and I have an error that after some web searching suggests that I set the MYSQL_DIR option for Cmake. In the documentation its called the 'MySQL server installation' directory. I can't reason out where this is. Here's why:

I used "sudo apt install mysql-server" to install the MySQL server.
A search for 'mysql' files on the system shows that mysql* files are in many directories.

Can you tell me what this would be on Ubuntu or give me examples?

MySQL 8.0.17: Connector/C++ released (no replies)

MySQL 8.0: Connector/C++ - 8.0.17 - leak? (no replies)

$
0
0
Hi there!

This short test code produces leaks by Valgrind!



{
std::string url = "mysqlx://uname:pwd@host.ip.add.ress:33080/schema";
Session mySession(url);
RowResult res = mySession.sql("SELECT id, username FROM users").execute();
Row row;
while ((row = res.fetchOne())) {
std::cout << "ID: " << row[0] << " - username: " << row[1] << std::endl;
}
mySession.close();
}


Valgrind reports:

"

...
...
==19407== HEAP SUMMARY:
==19407== in use at exit: 1,088 bytes in 2 blocks
==19407== total heap usage: 10,291 allocs, 10,289 frees, 805,113 bytes allocated
==19407==
==19407== Searching for pointers to 2 not-freed blocks
==19407== Checked 204,840 bytes
==19407==
==19407== 64 bytes in 1 blocks are still reachable in loss record 1 of 2
==19407== at 0x4835DEF: operator new(unsigned long) (vg_replace_malloc.c:334)
==19407== by 0x49BC561: ??? (in /usr/lib/x86_64-linux-gnu/libmysqlcppconn8.so.2.8.0.17)
==19407== by 0x49BEF97: ??? (in /usr/lib/x86_64-linux-gnu/libmysqlcppconn8.so.2.8.0.17)
==19407== by 0x49BF233: ??? (in /usr/lib/x86_64-linux-gnu/libmysqlcppconn8.so.2.8.0.17)
==19407== by 0x49851DB: ??? (in /usr/lib/x86_64-linux-gnu/libmysqlcppconn8.so.2.8.0.17)
==19407== by 0x49496DE: ??? (in /usr/lib/x86_64-linux-gnu/libmysqlcppconn8.so.2.8.0.17)
==19407== by 0x494F9CD: ??? (in /usr/lib/x86_64-linux-gnu/libmysqlcppconn8.so.2.8.0.17)
==19407== by 0x492C741: ??? (in /usr/lib/x86_64-linux-gnu/libmysqlcppconn8.so.2.8.0.17)
==19407== by 0x492D5A1: ??? (in /usr/lib/x86_64-linux-gnu/libmysqlcppconn8.so.2.8.0.17)
==19407== by 0x492E554: ??? (in /usr/lib/x86_64-linux-gnu/libmysqlcppconn8.so.2.8.0.17)
==19407== by 0x4921117: ??? (in /usr/lib/x86_64-linux-gnu/libmysqlcppconn8.so.2.8.0.17)
==19407== by 0x49083C9: mysqlx::abi2::r0::internal::Session_detail::Session_detail(mysqlx::abi2::r0::common::Settings_impl&) (in /usr/lib/x86_64-linux-gnu/libmysqlcppconn8.so.2.8.0.17)
==19407==
==19407== 1,024 bytes in 1 blocks are still reachable in loss record 2 of 2
==19407== at 0x4835DEF: operator new(unsigned long) (vg_replace_malloc.c:334)
==19407== by 0x49BCD25: void std::vector<std::pair<void (*)(void const*), void const*>, std::allocator<std::pair<void (*)(void const*), void const*> > >::_M_realloc_insert<std::pair<void (*)(void const*), void const*> >(__gnu_cxx::__n
==19407== by 0x49BC5B2: ??? (in /usr/lib/x86_64-linux-gnu/libmysqlcppconn8.so.2.8.0.17)
==19407== by 0x49BEF02: ??? (in /usr/lib/x86_64-linux-gnu/libmysqlcppconn8.so.2.8.0.17)
==19407== by 0x49BEEF6: ??? (in /usr/lib/x86_64-linux-gnu/libmysqlcppconn8.so.2.8.0.17)
==19407== by 0x49BEEF6: ??? (in /usr/lib/x86_64-linux-gnu/libmysqlcppconn8.so.2.8.0.17)
==19407== by 0x49BEEF6: ??? (in /usr/lib/x86_64-linux-gnu/libmysqlcppconn8.so.2.8.0.17)
==19407== by 0x49BF25B: ??? (in /usr/lib/x86_64-linux-gnu/libmysqlcppconn8.so.2.8.0.17)
==19407== by 0x498508B: ??? (in /usr/lib/x86_64-linux-gnu/libmysqlcppconn8.so.2.8.0.17)
==19407== by 0x4956B23: ??? (in /usr/lib/x86_64-linux-gnu/libmysqlcppconn8.so.2.8.0.17)
==19407== by 0x493DAF8: ??? (in /usr/lib/x86_64-linux-gnu/libmysqlcppconn8.so.2.8.0.17)
==19407== by 0x49426C8: ??? (in /usr/lib/x86_64-linux-gnu/libmysqlcppconn8.so.2.8.0.17)
==19407==
==19407== LEAK SUMMARY:
==19407== definitely lost: 0 bytes in 0 blocks
==19407== indirectly lost: 0 bytes in 0 blocks
==19407== possibly lost: 0 bytes in 0 blocks
==19407== still reachable: 1,088 bytes in 2 blocks
==19407== suppressed: 0 bytes in 0 blocks
==19407==
==19407== ERROR SUMMARY: 68125 errors from 626 contexts (suppressed: 0 from 0)
...
.
.
"


Installed libs:
ii libmysqlclient-dev 8.0.17-1debian10 amd64 MySQL development headers
ii libmysqlclient21:amd64 8.0.17-1debian10 amd64 MySQL shared client libraries
ii libmysqlcppconn-dev:amd64 8.0.17-1debian10 amd64 Development header files and libraries for MySQL C++ client applications
ii libmysqlcppconn7:amd64 8.0.17-1debian10 amd64 MySQL Driver for C++ which mimics the JDBC 4.0 API
ii libmysqlcppconn8-2:amd64 8.0.17-1debian10 amd64 MySQL database connector for C++
ii mysql-apt-config 0.8.13-1 all Auto configuration for MySQL APT Repo.
ii mysql-common 8.0.17-1debian10 amd64 Common files shared between packages



Is this false positive or not?


Thx!

Cs

MySQL Connector\C++ and Win64 (1 reply)

$
0
0
-Does the Win64 version of the latest C++ Driver for MySQL, particularly its *.lib files, come compatible with MSVC++ linker and compiler, or are they GNU/TDM compatible?

Is it compatible with the MS compiler, th TDM (GNU) style compiler, or both of them?

Problem while using MySQL connector API (no replies)

$
0
0
Dear Team,

Currently, I am integrating MySQL database with C++ based application as a document storage.

I have created a data in MySQL database using MySQL API for create document.

While retrieving the data from MySQL database, it is returning DbDoc object for accessing json data.

When i am trying to cast or convert that object to some other type like for rapidjson object or Json object,
for example: DbDoc to string
error: conversion from ‘mysqlx::abi2::r0::DbDoc’ to non-scalar type ‘std::string {aka std::basic_string<char>}’ requested

I tried to access the field of json data using DbDoc object, it is returning an empty data with cout for printing on console.
like:
DbDoc doc=coll.find("_id.id = :id").bind("id", id).execute().fetchOne();
cout<<doc["_id"]

output:
<document>

Could you please provide your suggestion or guidance on the same. It will help me a lot.

Problem using string manipulation functions with MySql. (no replies)

$
0
0
// I have a MySQL 8.0.17 database sample project I am compiling using
// Visual Studio CE 2017 on a 64 bit windows machine. It is a console
// app. See the code below it's boilerplate. The issue I have is
// when trying to manipulate strings after initializing the database.
// ie: uncommenting the sprintf_s() causes an exception to be thrown.
//
// I am trying to understand if this is somehow by design or is it a
// bug? Or is there something else I may be doing wrong?

#include "pch.h"
#include <windows.h>
#include <iostream>
#include <winsock.h>
#include <stdio.h>
#include <mysql.h>

int main()
{
std::cout << "Hello World!\n";
MYSQL conn;
MYSQL_RES *res_set;
MYSQL_ROW row;

mysql_init(&conn);

char str[6];
// sprintf_s(str, 5, "test");

if(!mysql_real_connect(&conn,"localhost","usr","pas","db",0,NULL,0))
{ fprintf(stderr, "Connection Failed: %s\n", mysql_error(&conn));
} else
{ fprintf(stderr, "Successfully connected to Database.\n");
int status = mysql_query(&conn, "SELECT * FROM users");
res_set = mysql_store_result(&conn);
int count = mysql_num_rows(res_set);
printf("No of rows = %d\n", count);
while ((row = mysql_fetch_row(res_set)) != NULL)
{ for (int i = 0; i < mysql_num_fields(res_set); i++)
{ printf("%s \t", row != NULL ? row : "NULL");
} printf("\n");
}
}
mysql_close(&conn);
// getchar();
return 0;
}

// I find it interesting that if I place the sprintf_s() above
// the mysql_init() it works just fine? So does that mean I
// need to open a new connection on each request? Because it
// did not work this way in version 5.7 Where I could establish
// a connection then execute several statements.? I'm
// experimenting with using prepared statements? Any response
// would be greatly appreciated as I've been struggling with
// this for a while now... The following is the Exception being
// thrown...

Exception thrown at 0x00007FFED78550C0 (libmysql.dll) in ConsoleApplication1.exe: 0xC0000005: Access violation reading location 0x0000000000000000.

//Now why is that happening?
Viewing all 527 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>