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

MySQL Connector 8.0 Session init error :cdk::foundation::Generic_error (no replies)

$
0
0
my code blow:

envrionment: win32/vs2015

Session sess("192.168.1.101", 3306, "root", "zhangkai", "test");

when I init the session ,It got an error:

0x76FE1932 error happend cdk::foundation::Generic_error, mysqlx::abi2::r0::Error,

did any meet the same error with me>

Microsoft C++ Exception std::out_of_range mysql-connector-c++-8.0.18-winx64 (no replies)

$
0
0
Visual Studio 2019 Pro
mysqld.exe 8.0.17 x64
I am using mysqlcppconn8-static.lib, downloaded from MySQL site.

This is not a fatal exception, the query result is correct. The exception appears to be thrown every time that the code reads the database. I have not seen the exception occur when writing to the database.

Code to reproduce the error:
MySQLTest()
{
mysqlx::Session session( DATABASE_URL );
mysqlx::RowResult result;
mysqlx::Row row;
mysqlx::Value value;
std::wstring path;
int id;

result = session.getSchema( DATABASE_SCHEMA_CONFIGURATION ) // Expands to L"schema_name"
.getTable( L"resource_paths" )
.select( L"id", L"path" )
.execute();
if( row_count > 0 )
{
row = result.fetchOne();
while( !row.isNull() )
{
size_t col_count = row.colCount();
value = row[0]; // throws std::out_of_range, value contains correct data
id = GetResourceIdFromDBString( static_cast<std::wstring>( value ) ); // Convert string id to numeric id
value = row[1]; // throws std::out_of_range, value contains correct data
path = static_cast<std::wstring>( value );
// Do some interesting stuff with the path
row = result.fetchOne();
}
}
}

It appears that the exception originates with mysqlx::Value& Row_detail::get_val(mysqlx::col_count_t pos) in result.cc but I do not have the pdb files to be able to trace it all the way. I have traced it to Value& get(col_count_t pos) in include\mysqlx\devapi\row.h

Thank you.

read access violation in xdevapi 8.0.17 (1 reply)

$
0
0
I keep seeing an access violation in the MySQL dll. It appears to be random, not 100% of the time, but happens frequently. Originally I thought that I was allowing the session to be destroyed before the results, but I created a small wrapper to ensure that results are always destroyed before the session.

Here's the snippet of my most relevant code. I'm not sure that this is the function that's failing (unfortunately putting breakpoints in changes the timing enough that it significantly reduces the chances of this happening.) You can see that I create move-construct the session into a shared_ptr, construct the Statement for later execution, pass the shared_ptr to query which executes the statement on a thread in my thread pool, and pack the results into a shared pointer (since results don't seem to be copyable but are movable) and a copy of the shared_ptr to the session into a simple result wrapper. The wrapper exists to be copyable and to ensure that the last shared_ptr to the results is released before the last shared_ptr to the session, ensuring that the session's lifespan is longer than the results. I'm not sure all this should strictly speaking be necessary, but I've been chasing this null pointer exception for a while and since the null pointer being dereferenced is the session, I sort of assumed that I was allowing the session to be destroyed before the results. Maybe there's a bug in this code, but it ought to guarantee that the session is not destroyed before the results, and indeed when I look at it in my debugger my session shared pointer is valid.

template< typename Result >
class result_ptr
{
public:
using result_t = Result;

private:
std::shared_ptr< result_t > Result_;
std::shared_ptr< msx::Session > Session_;

public:
result_ptr( ) { }

result_ptr( result_t && result, decltype( Session_ ) session ) :
Result_( std::make_shared< result_t >( std::move( result ) ) ),
Session_( session )
{ }

~result_ptr( )
{
Result_.reset( );
Session_.reset( );
}

result_ptr( result_ptr && ) = default;
result_ptr( result_ptr const & ) = default;

result_ptr & operator=( result_ptr && ) = default;
result_ptr & operator=( result_ptr const & ) = default;

auto & operator*( ) const noexcept
{
return *Result_;
}

auto operator->( ) const noexcept
{
return Result_.get( );
}
};

template< typename Exec >
inline auto query( ContextId const &, std::shared_ptr< msx::Session > session, Exec statement ) -> ppl::task< result_ptr< decltype( statement.execute( ) ) > >
{
return ppl::create_task(
[session, s = std::make_shared< Exec >( std::move( statement ) )]( )
{
try
{
return result_ptr< decltype( s->execute( ) ) >( s->execute( ), session );
}
catch( std::exception const & ex )
{
so::cout << ex.what( ) << "\n";
throw;
}
} );
};

ppl::task< std::vector< TaskId > > MySQLQueue::getReadyTasks(
ContextId const & contextId,
unsigned int const limit )
{
using result_type = decltype( u::query( contextId, std::shared_ptr< msx::Session >( ), Client_.getSession( ).getSchema( "" ).getTable( "" ).select( ) ) )::result_type;

auto session = std::make_shared< msx::Session >( Client_.getSession( ) );

return u::query(
contextId,
session,
session->getSchema( SchemaName_ ).getTable( TableName_
).select(
info::column::select[info::column::_id]
).where(
"state = :state AND processAfter < :processAfter"
).limit(
limit
).bind( std::map< std::string, std::string >{
{ "state", Info::State::String[Info::State::Created] },
{ "processAfter", utility::time_point_to_string( clock::now( ) ) } }
)
).then(
[]( result_type const & res )
{
std::vector< TaskId > rv;
rv.reserve( res->count( ) );

std::transform(
res->begin( ),
res->end( ),
std::back_inserter( rv ),
[]( msx::Row && row ) -> TaskId
{
return std::to_string( row[0].get< uint64_t >( ) );
} );

return rv;
} );
}

I cannot figure out why this is resulting in an access violation. The AV error message when the exception is trapped is:

Exception thrown: read access violation.
this->m_session was nullptr.

You can see from the call stack that the AV is actually buried pretty deep in the MySQL dll:

mysqlcppconn8-2-vs14.dll!cdk::mysqlx::Reply::has_results() Line 132 C++
mysqlcppconn8-2-vs14.dll!cdk::mysqlx::Reply::discard() Line 102 C++
mysqlcppconn8-2-vs14.dll!cdk::mysqlx::Reply::~Reply() Line 59 C++
mysqlcppconn8-2-vs14.dll!cdk::Reply::~Reply() C++
mysqlcppconn8-2-vs14.dll!cdk::Reply::`scalar deleting destructor'(unsigned int) C++
mysqlcppconn8-2-vs14.dll!mysqlx::abi2::r0::common::Result_impl::~Result_impl() Line 181 C++
mysqlcppconn8-2-vs14.dll!mysqlx::abi2::r0::common::Result_impl::`scalar deleting destructor'(unsigned int) C++
mysqlcppconn8-2-vs14.dll!mysqlx::abi2::r0::internal::Result_detail::~Result_detail() Line 493 C++
cgrmerge.exe!mysqlx::abi2::r0::internal::Result_common<mysqlx::abi2::r0::internal::Result_detail>::~Result_common<mysqlx::abi2::r0::internal::Result_detail>() C++
cgrmerge.exe!mysqlx::abi2::r0::Result::~Result() C++
cgrmerge.exe!mysqlx::abi2::r0::Result::`scalar deleting destructor'(unsigned int) C++
cgrmerge.exe!std::_Destroy_in_place<mysqlx::abi2::r0::Result>(mysqlx::abi2::r0::Result & _Obj) Line 322 C++
cgrmerge.exe!std::_Ref_count_obj2<mysqlx::abi2::r0::Result>::_Destroy() Line 1506 C++
cgrmerge.exe!std::_Ref_count_base::_Decref() Line 652 C++
cgrmerge.exe!std::_Ptr_base<mysqlx::abi2::r0::Result>::_Decref() Line 883 C++
> cgrmerge.exe!std::shared_ptr<mysqlx::abi2::r0::Result>::~shared_ptr<mysqlx::abi2::r0::Result>() Line 1133 C++
cgrmerge.exe!std::shared_ptr<mysqlx::abi2::r0::Result>::reset() Line 1178 C++
cgrmerge.exe!utility::result_ptr<mysqlx::abi2::r0::Result>::~result_ptr<mysqlx::abi2::r0::Result>() Line 60 C++
cgrmerge.exe!pplx::details::_ResultHolder<utility::result_ptr<mysqlx::abi2::r0::Result>>::~_ResultHolder<utility::result_ptr<mysqlx::abi2::r0::Result>>() C++
cgrmerge.exe!pplx::details::_Task_impl<utility::result_ptr<mysqlx::abi2::r0::Result>>::~_Task_impl<utility::result_ptr<mysqlx::abi2::r0::Result>>() Line 2432 C++
cgrmerge.exe!pplx::details::_Task_impl<utility::result_ptr<mysqlx::abi2::r0::Result>>::`scalar deleting destructor'(unsigned int) C++
cgrmerge.exe!std::_Destroy_in_place<pplx::details::_Task_impl<utility::result_ptr<mysqlx::abi2::r0::Result>>>(pplx::details::_Task_impl<utility::result_ptr<mysqlx::abi2::r0::Result>> & _Obj) Line 322 C++
cgrmerge.exe!std::_Ref_count_obj2<pplx::details::_Task_impl<utility::result_ptr<mysqlx::abi2::r0::Result>>>::_Destroy() Line 1506 C++
cgrmerge.exe!std::_Ref_count_base::_Decref() Line 652 C++
cgrmerge.exe!std::_Ptr_base<pplx::details::_Task_impl<utility::result_ptr<mysqlx::abi2::r0::Result>>>::_Decref() Line 883 C++
cgrmerge.exe!std::shared_ptr<pplx::details::_Task_impl<utility::result_ptr<mysqlx::abi2::r0::Result>>>::~shared_ptr<pplx::details::_Task_impl<utility::result_ptr<mysqlx::abi2::r0::Result>>>() Line 1133 C++
cgrmerge.exe!pplx::task<utility::result_ptr<mysqlx::abi2::r0::Result>>::_ContinuationTaskHandle<utility::result_ptr<mysqlx::abi2::r0::Result>,utility::result_ptr<mysqlx::abi2::r0::Result>,`ScheduledTask::MySQLQueue::recover'::`2'::<lambda_1>,std::integral_constant<bool,0>,pplx::details::_TypeSelectorAsyncTask>::~_ContinuationTaskHandle<utility::result_ptr<mysqlx::abi2::r0::Result>,utility::result_ptr<mysqlx::abi2::r0::Result>,`ScheduledTask::MySQLQueue::recover'::`2'::<lambda_1>,std::integral_constant<bool,0>,pplx::details::_TypeSelectorAsyncTask>() Line 3871 C++
cgrmerge.exe!pplx::task<utility::result_ptr<mysqlx::abi2::r0::Result>>::_ContinuationTaskHandle<utility::result_ptr<mysqlx::abi2::r0::Result>,utility::result_ptr<mysqlx::abi2::r0::Result>,`ScheduledTask::MySQLQueue::recover'::`2'::<lambda_1>,std::integral_constant<bool,0>,pplx::details::_TypeSelectorAsyncTask>::`scalar deleting destructor'(unsigned int) C++
cgrmerge.exe!pplx::details::_AutoDeleter<pplx::details::_TaskProcHandle>::~_AutoDeleter<pplx::details::_TaskProcHandle>() Line 99 C++
cgrmerge.exe!pplx::details::_TaskProcHandle::_RunChoreBridge(void * _Parameter) Line 117 C++
cpprest141d_2_10.dll!pplx::details::_Scheduler_Param::DefaultWorkCallback(struct _TP_CALLBACK_INSTANCE *,void *,struct _TP_WORK *) Unknown
ntdll.dll!TppWorkpExecuteCallback() Unknown
ntdll.dll!TppWorkerThread() Unknown
kernel32.dll!BaseThreadInitThunk?() Unknown
ntdll.dll!RtlUserThreadStart?() Unknown

Any help would be greatly appreciated.

Post is not appearing in topic list (no replies)

$
0
0
The topic title is: Static build of connector fails with C2079 mysqlx_row_struct not defined

I can see the post in my Follow Topics list but it has the date 12/31/1969. How do I get this to show in the topic list?

get_driver_instance is unresolved (2 replies)

$
0
0
I'm building a small MySQL app with VS 2019. I'm linking against the X64 debug binaries and explicitly including mysqlcppconn8-static.lib. The app makes many calls to connector api's, but get_driver_instance is the only one that turns up as unresolved.

I've noted that this problem has recurred with many connector releases over the years. Could someone at Oracle PLEASE figure out why and fix it permanently? In the meantime, I'd like a workaround (if there is one) so I can continue development?

Where is ResultSet::updateRow etc. in the JDBC API? (no replies)

$
0
0
Does the C++ connector still support updateRow and kindred functions in the JDBC api? If not, is there equivalent functionality, still within the JDBC api?

Connection Timeout on remote DB connection (no replies)

$
0
0
I am trying to use the c++ connector to connect to a remote db I am running on a virtual linux box. I keep getting this error:

CDK Error: Connection attempt to the server was aborted. Timeout of 10000 milliseconds was exceeded

This is my code:

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

int main()
{
try {
Session sess("db", 33060, "<user>", "<password>");
}
catch (const Error & err)
{
std::cout << "ERROR: " << err << std::endl;
}
catch (std::exception & ex)
{
std::cout << "STD EXCEPTION: " << ex.what() << std::endl;
}
catch (const char* ex)
{
std::cout << "EXCEPTION: " << ex << std::endl;
}


It works perfectly fine when I connect to localhost instance of mysql so I am not sure what the problem is. I can also connect to the remote db with mysql workbench so..?

How do I insert or query geometry value with X DevAPI? (no replies)

$
0
0
I have a table which holds a POINT geometry field, now I need to insert value using connector/C++ 8. With normal SQL it's easy:
INSERT INTO geom(center) VALUES (ST_GeomFromText('POINT(1,2)'));
Question is how do I do the same with connector/C++ 8? I have tried using TableInsert like this:
auto insert = db.getTable("detection").insert("center").values("ST_GeomFromText('POINT(1,2)')");

or

db.getTable("detection").insert("center").values("POINT(1,2)");

Neither way worked, with exception message "CDK Error: Cannot get geometry object from data you send to the GEOMETRY field".

I need your help and appreciate for that.

I need help with a build of mysql connector 8 test code which fails with symbols not found for architecture x86-64. (no replies)

$
0
0
This is the code that is to be compiled:

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

using namespace mysqlx;

string usr = "root";
string pwd = “password”;

int main()
{
Session mySession(SessionOption::HOST, "localhost",
SessionOption::PORT, 33060,
SessionOption::USER, usr,
SessionOption::PWD, pwd);

return 0;
}



The following is the output from the build console:


12:51:32 **** Incremental Build of configuration Debug for project SQL_Test_1 ****
make all
Building file: ../main.cpp
Invoking: GCC C++ Compiler
g++ -std=c++0x -I/repository_source_code/openssl/openssl-1.0.2u/include -I/repository_source_code/mysql/connector/mysql-connector-cpp-8.0.18/mysql-connector-cpp-8.0.18/include -I/repository_source_code/boost/boost_1_72_0/boost -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"main.d" -MT"main.o" -o "main.o" "../main.cpp"
In file included from ../main.cpp:2:
In file included from /repository_source_code/mysql/connector/mysql-connector-cpp-8.0.18/mysql-connector-cpp-8.0.18/include/mysqlx/xdevapi.h:93:
In file included from /repository_source_code/mysql/connector/mysql-connector-cpp-8.0.18/mysql-connector-cpp-8.0.18/include/mysqlx/devapi/common.h:35:
In file included from /repository_source_code/mysql/connector/mysql-connector-cpp-8.0.18/mysql-connector-cpp-8.0.18/include/mysqlx/devapi/../common.h:46:
In file included from /repository_source_code/mysql/connector/mysql-connector-cpp-8.0.18/mysql-connector-cpp-8.0.18/include/mysqlx/common/error.h:40:
/repository_source_code/mysql/connector/mysql-connector-cpp-8.0.18/mysql-connector-cpp-8.0.18/include/mysqlx/common/util.h:339:10: warning: moving a local object in a return statement prevents copy elision [-Wpessimizing-move]
return std::move(uc_val);
^
/repository_source_code/mysql/connector/mysql-connector-cpp-8.0.18/mysql-connector-cpp-8.0.18/include/mysqlx/common/util.h:339:10: note: remove std::move call here
return std::move(uc_val);
^~~~~~~~~~ ~
/repository_source_code/mysql/connector/mysql-connector-cpp-8.0.18/mysql-connector-cpp-8.0.18/include/mysqlx/common/util.h:350:10: warning: moving a local object in a return statement prevents copy elision [-Wpessimizing-move]
return std::move(uc_val);
^
/repository_source_code/mysql/connector/mysql-connector-cpp-8.0.18/mysql-connector-cpp-8.0.18/include/mysqlx/common/util.h:350:10: note: remove std::move call here
return std::move(uc_val);
^~~~~~~~~~ ~
2 warnings generated.
Finished building: ../main.cpp

Building target: SQL_Test_1
Invoking: MacOS X C++ Linker
g++ -L/repository_source_code/mysql/connector/mysql-connector-cpp-8.0.18/mysql-connector-cpp-8.0.18/lib64 -o "SQL_Test_1" ./main.o
Undefined symbols for architecture x86_64:
"mysqlx::abi2::r0::common::Settings_impl::Data::init_connection_attr()", referenced from:
mysqlx::abi2::r0::common::Settings_impl::Data::Data() in main.o
"mysqlx::abi2::r0::string::Impl::to_utf8(mysqlx::abi2::r0::string const&)", referenced from:
mysqlx::abi2::r0::string::traits<char>::to_str(mysqlx::abi2::r0::string const&) in main.o
"mysqlx::abi2::r0::string::Impl::from_utf8(mysqlx::abi2::r0::string&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
mysqlx::abi2::r0::string::traits<char>::from_str(mysqlx::abi2::r0::string&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in main.o
"mysqlx::abi2::r0::internal::Session_detail::close()", referenced from:
mysqlx::abi2::r0::internal::Session_detail::~Session_detail() in main.o
"mysqlx::abi2::r0::internal::Session_detail::Session_detail(mysqlx::abi2::r0::common::Settings_impl&)", referenced from:
mysqlx::abi2::r0::Session::Session(mysqlx::abi2::r0::SessionSettings) in main.o
"mysqlx::abi2::r0::internal::Settings_detail<mysqlx::abi2::r0::internal::Settings_traits>::do_set(std::__1::list<std::__1::pair<int, mysqlx::abi2::r0::common::Value>, std::__1::allocator<std::__1::pair<int, mysqlx::abi2::r0::common::Value> > >&&)", referenced from:
void mysqlx::abi2::r0::internal::Settings_detail<mysqlx::abi2::r0::internal::Settings_traits>::set<true, mysqlx::abi2::r0::SessionOption::Enum, char const*&, mysqlx::abi2::r0::SessionOption::Enum&, int&, mysqlx::abi2::r0::SessionOption::Enum&, mysqlx::abi2::r0::string&, mysqlx::abi2::r0::SessionOption::Enum&, mysqlx::abi2::r0::string&>(mysqlx::abi2::r0::SessionOption::Enum, char const*&&&, mysqlx::abi2::r0::SessionOption::Enum&&&, int&&&, mysqlx::abi2::r0::SessionOption::Enum&&&, mysqlx::abi2::r0::string&&&, mysqlx::abi2::r0::SessionOption::Enum&&&, mysqlx::abi2::r0::string&&&) in main.o
"mysqlx::abi2::r0::common::Value::print(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const", referenced from:
mysqlx::abi2::r0::Value::print(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const in main.o
construction vtable for mysqlx::abi2::r0::common::Value-in-mysqlx::abi2::r0::Value in main.o
"typeinfo for mysqlx::abi2::r0::common::Value", referenced from:
construction vtable for mysqlx::abi2::r0::common::Value-in-mysqlx::abi2::r0::Value in main.o
typeinfo for mysqlx::abi2::r0::Value in main.o
"VTT for mysqlx::abi2::r0::common::Value", referenced from:
mysqlx::abi2::r0::common::Value::~Value() in main.o
"vtable for mysqlx::abi2::r0::DbDoc", referenced from:
mysqlx::abi2::r0::DbDoc::~DbDoc() in main.o
mysqlx::abi2::r0::DbDoc::DbDoc() in main.o
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
"vtable for mysqlx::abi2::r0::common::Value", referenced from:
mysqlx::abi2::r0::common::Value::Value(std::__1::basic_string<char16_t, std::__1::char_traits<char16_t>, std::__1::allocator<char16_t> > const&) in main.o
mysqlx::abi2::r0::common::Value::Value(long long) in main.o
mysqlx::abi2::r0::common::Value::Value(mysqlx::abi2::r0::common::Value&&) in main.o
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [SQL_Test_1] Error 1

12:51:33 Build Finished (took 1s.299ms)

From the looks of this output it seems that there are 10 undefined symbols. Can anybody help interpret this output?

Mysql connector c++ 8.0. How to work with datetime? (1 reply)

$
0
0
I have table like:

CREATE TABLE `table_name` (
`id` int unsigned NOT NULL AUTO_INCREMENT,
`date_update` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

I have C++ code:

RowResult res = mysession.sql("SELECT id, date_update FROM table_name").execute();

Row row;
while ((row = res.fetchOne())) {
cout << "Id: " << row[0] << endl; // Ok
std::string data_update = row[1]; // How to get datetime here?
// row[1].getType() == Type::Document(8)
}

row[1] - is variable with type mysqlx::Value with type Document.
How should i read field date_update?

Connector/C++ v 8 and binding parameters (2 replies)

$
0
0
I'm using the JDBC subset of the v 8 C++ connector. I can't find the equivalent of the mysql_stmt_bind_param function that was available in the 5.7 api. The 8.0 header prepared_statement.h has a bunch of functions, but none that seems parallel. How do I accomplish the same functionality using the 8.0 C++ connector?

Connector 1.1.19 cpp (2 replies)

$
0
0
Hi
I use cmysql connector 1.1.9 with cpp under visual studio 2019. no problem with
the kit. I a just want to modify the timeout read with function setClientOptions.
is it possible? if Yes can you give me a example cpp.
Thanks

Jean BEZET

Connector 1.1.19 cpp getstring error (3 replies)

$
0
0
Hy

Visual studio 2019 I have a menory failed at the end off the code:
when i'm over the instruction break it's try to delete the string tt
and it's make a exeption !!!

the query extract the correclyt data from the database only one record and row.


while (result->next())
{
string tt = result->getString("date");
Mess_DATE = tt.c_str();
if (tt.c_str() != CHAINE_VIDE)
{
Error = (int)Calcul_Date::BD_OK;
Extract_Date(tt.c_str());
}
else
{
// Error MDP or password invalid
Error = (int)Calcul_Date::BD_INVALID_USER_OR_PASSWORD;
}
break;
}

Connector 1.1.19 cpp getstring error more informations (no replies)

$
0
0
Hy
when i use library as 1.1.19, it's the same

list off dll loaded:

'FTPexample.exe'. Les symboles ont été chargés.
'C:\Windows\SysWOW64\ntdll.dll'.
'C:\Windows\SysWOW64\kernel32.dll'.
'C:\Windows\SysWOW64\KernelBase.dll'.
'C:\Windows\SysWOW64\user32.dll'.
''I:\Projets\ftpclient_demo_mfc\FtpClient_Demo_Mfc\Release\msvcp140.dll'.
'I:\Projets\ftpclient_demo_mfc\FtpClient_Demo_Mfc\Release\mfc140.dll'.
'C:\Windows\SysWOW64\win32u.dll'.
''C:\Windows\SysWOW64\ucrtbase.dll'.
'C:\Windows\SysWOW64\advapi32.dll'.
'C:\Windows\SysWOW64\gdi32.dll'.
'C:\Windows\SysWOW64\vcruntime140.dll'.
'C:\Windows\SysWOW64\msvcrt.dll'.
'C:\Windows\SysWOW64\gdi32full.dll'.
'C:\Windows\SysWOW64\sechost.dll'.
'Chargé 'C:\Windows\SysWOW64\msvcp_win.dll'.
Chargé 'C:\Windows\SysWOW64\rpcrt4.dll'.
'C:\Windows\SysWOW64\shell32.dll'.
'C:\Windows\SysWOW64\sspicli.dll'.
'C:\Windows\SysWOW64\cryptbase.dll'.
''C:\Windows\SysWOW64\cfgmgr32.dll'.
'C:\Windows\SysWOW64\bcryptprimitives.dll'.
'C:\Windows\SysWOW64\SHCore.dll'.
'C:\Windows\SysWOW64\combase.dll'.
'C:\Windows\SysWOW64\ole32.dll'.
'C:\Windows\SysWOW64\windows.storage.dll'.
'C:\Windows\SysWOW64\oleaut32.dll'.
'C:\Windows\SysWOW64\shlwapi.dll'.
'C:\Windows\SysWOW64\profapi.dll'.
'C:\Windows\SysWOW64\powrprof.dll'.
'C:\Windows\SysWOW64\imm32.dll'.
'C:\Windows\SysWOW64\umpdc.dll'.
'C:\Windows\SysWOW64\kernel.appcore.dll'.
'C:\Windows\SysWOW64\uxtheme.dll'.
'C:\Windows\SysWOW64\cryptsp.dll'.
'C:\Windows\SysWOW64\ws2_32.dll'.
'C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.18362.592_none_71d995095ae1acb5\comctl32.dll'.
'I:\Projets\ftpclient_demo_mfc\FtpClient_Demo_Mfc\Release\mysqlcppconn.dll'.
''I:\Projets\ftpclient_demo_mfc\FtpClient_Demo_Mfc\Release\libmysql.dll'. Le module a été généré sans symboles.
'I:\Projets\ftpclient_demo_mfc\FtpClient_Demo_Mfc\Release\libmysql.dll'
'C:\Windows\WinSxS\x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.9659_none_d08cfd96442b25cc\msvcr80.dll'.
''C:\Windows\WinSxS\x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.9659_none_d08cfd96442b25cc\msvcp80.dll'.
'I:\Projets\ftpclient_demo_mfc\FtpClient_Demo_Mfc\Release\libmysql.dll'. Le module a été généré sans symboles.
'C:\Windows\SysWOW64\wsock32.dll'.
'C:\Windows\SysWOW64\NapiNSP.dll'.
'C:\Windows\SysWOW64\pnrpnsp.dll'.
'C:\Windows\SysWOW64\mswsock.dll'.
'C:\Windows\SysWOW64\dnsapi.dll'.
'C:\Windows\SysWOW64\nsi.dll'.
'C:\Windows\SysWOW64\IPHLPAPI.DLL'.
'C:\Windows\SysWOW64\winrnr.dll'.
Chargé 'C:\Windows\SysWOW64\nlaapi.dll'.
Chargé 'C:\Windows\SysWOW64\wshbth.dll'.
Chargé 'C:\Windows\SysWOW64\rasadhlp.dll'.
'C:\Windows\SysWOW64\clbcatq.dll'.
'Chargé 'C:\Windows\SysWOW64\FirewallAPI.dll'.
Chargé 'C:\Windows\SysWOW64\fwbase.dll'.
Chargé 'C:\Windows\SysWOW64\fwpolicyiomgr.dll'.
' Chargé 'C:\Windows\SysWOW64\riched32.dll'.
Chargé 'C:\Windows\SysWOW64\riched20.dll'.
Chargé 'C:\Windows\SysWOW64\usp10.dll'.
Chargé 'C:\Windows\SysWOW64\msls31.dll'.
Chargé 'C:\Windows\SysWOW64\msctf.dll'.
C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.18362.592_none_2e6de868278ee708\comctl32.dll'.
Chargé 'C:\Windows\SysWOW64\TextInputFramework.dll'.
'C:\Windows\SysWOW64\CoreUIComponents.dll'.
'C:\Windows\SysWOW64\CoreMessaging.dll'.
'C:\Windows\SysWOW64\ntmarta.dll'.
'C:\Windows\SysWOW64\WinTypes.dll'.
''C:\Windows\SysWOW64\FWPUCLNT.DLL'.
'C:\Windows\SysWOW64\bcrypt.dll'.
''C:\Windows\SysWOW64\iertutil.dll'.

Connector 1.1.19 cpp getstring error Libary generation (no replies)

$
0
0
Infact if string Result_BD_QUERY is local to myfunction all it's all but at the end
all the object local are deleted and a error occur
So I supose that connector has been generate with viusal sutdio option /Mt my project is generated with /MD

So the stack is different ==> Do crash

lok to the site page :
https://stackoverflow.com/questions/4822958/mysql-c-connector-getstring-doesnt-work-correctly-while-getint-works-perfe


My code here bellow

.....
result->next(); // point to thr first Record

string Result_BD_QUERY = result->getString(1);

Mess_DATE = Result_BD_QUERY.c_str();
if (Result_BD_QUERY.c_str() != (char *)CHAINE_VIDE)
{
Error = (int)Calcul_Date::BD_OK;
Extract_Date((CString)Result_BD_QUERY.c_str());
}
else
{
// Error MDP or password invalid
Error = (int)Calcul_Date::BD_INVALID_USER_OR_PASSWORD;
}

delete result;
delete stmt;
delete con;
}
catch (sql::SQLException e)
{
return(Error);
}
return(Error);
}
return((int)Calcul_Date::BD_INIT_FAILED);

Stored Procedure call fails with unhelpful error. (no replies)

$
0
0
I have a stored procedure set up in my MySQL instance.

CREATE DEFINER=`root`@`%` PROCEDURE `testProc`(
IN New_state enum('Created','Active','Cancelled','Completed','Failed','Expired','Removed'),
IN Node_id varchar(80),
IN Process_start_time datetime,
IN Task_id bigint,
IN Old_state enum('Created','Active','Cancelled','Completed','Failed','Expired','Removed') )

From MySQL workbench I can call it as you would expect using:

CALL lockTask( 'Active', 'workbench', '2020-01-30 21:14:58', 48, 'Created');

The procedure executes and I get the result set as expected. I have not been able to successfully call the procedure through the C++ connector. If I simply hard code the call in c++ it works fine:

session->sql(
"CALL test.lockTask( 'Active', 'testId', '2020-01-30 21:14:58', 50, 'Created' )" ).execute( );

The problem comes when I want to feed some sort of variable in. If I do the following:

session->sql(
"CALL test.lockTask( 'Active', 'testId', '2020-01-30 21:14:58', :Task_id, 'Created' )"
).bind(
"Task_id", static_cast< int64_t >( id )
).execute( )

it throws the following exception:

"CDK Error: Too many arguments"

Which makes little to no sense as there are still five arguments, one is a placeholder, and I'm only trying to bind one argument. I'm kind of at a loss here, and any help would be appreciated. Thanks.

MySQL 8.0: Connector/C++ Master/Slave Replication (no replies)

CDK Error: Reply blocked by a previous one. (no replies)

$
0
0
Ever since 8.0.18 C++ connector I've been getting this error:

CDK Error: Reply blocked by a previous one.

8.0.17 works great.

Any idea what would throw this error?

Connector/C++ 8.0 Get Output Parameter (1 reply)

$
0
0
I have a stored procedure I call which inserts a new record into database, this stored procedure has an output parameter that I use to get the new auto_increment id of the record.

I'm trying to use the following to retrieve the output parameter's value, but this is from the documentation for MySQL Connector 1.1, I using 8.0. Is this the correct way?

It actually works but the SqlResult has a single column without a column name (column name is blank). So if I use two output params I'm not sure how to retrieve them by name?

mysqlx::SqlStatement sql = sqlSession.sql("SELECT @p_table1_id AS _table1_id");

mysqlx::SqlResult sqlResult = sql.execute();

Thanks!

IBM DB2 migrate (Lift & Shift) to MySQL Cloud Service (no replies)

$
0
0
HI,

I need to understand capabilities, best practices for migrating IBM DB2 version 9 (on-prem) to Oracle MySQL Cloud Service. Does anyone have experience or recommendations?

thanks,

-Mark
Viewing all 527 articles
Browse latest View live


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