Re: [sqlite] Weird issue with the query

2016-12-02 Thread Igor Korot
Simon, On Fri, Dec 2, 2016 at 9:47 PM, Simon Slavin wrote: > > On 3 Dec 2016, at 2:44am, Igor Korot wrote: > >> Ok so in order to fix it I should assign the result of conversion to some >> variable? > > It might be simpler to use SQLITE_TRANSIENT instead of SQLITE_STATIC. > >

Re: [sqlite] Weird issue with the query

2016-12-02 Thread Igor Korot
Igor Ok so in order to fix it I should assign the result of conversion to some variable? Thank you. On Dec 2, 2016 9:07 PM, "Igor Tandetnik" wrote: On 12/2/2016 8:39 PM, Igor Tandetnik wrote: > On 12/2/2016 6:56 PM, Igor Korot wrote: > >> res = sqlite3_bind_text( stmt, 1, >> sqlite_pim

Re: [sqlite] Weird issue with the query

2016-12-02 Thread Simon Slavin
On 3 Dec 2016, at 2:44am, Igor Korot wrote: > Ok so in order to fix it I should assign the result of conversion to some > variable? It might be simpler to use SQLITE_TRANSIENT instead of SQLITE_STATIC. Simon. ___

Re: [sqlite] Weird issue with the query

2016-12-02 Thread Igor Korot
Igor Ok so in order to fix it I should assign the result of conversion to some variable? Thank you. On Dec 2, 2016 9:07 PM, "Igor Tandetnik" wrote: > On 12/2/2016 8:39 PM, Igor Tandetnik wrote: > >> On 12/2/2016 6:56 PM, Igor Korot wrote: >> >>> res = sqlite3_bind_text( stmt, 1, >>> sql

Re: [sqlite] Weird issue with the query

2016-12-02 Thread Igor Tandetnik
On 12/2/2016 8:39 PM, Igor Tandetnik wrote: On 12/2/2016 6:56 PM, Igor Korot wrote: res = sqlite3_bind_text( stmt, 1, sqlite_pimpl->m_myconv.to_bytes( tableName.c_str() ).c_str(), -1, SQLITE_STATIC ); SQLITE_STATIC tells SQLite that the string will outlive the statement handle. But in

Re: [sqlite] Weird issue with the query

2016-12-02 Thread Igor Tandetnik
On 12/2/2016 6:56 PM, Igor Korot wrote: res = sqlite3_bind_text( stmt, 1, sqlite_pimpl->m_myconv.to_bytes( tableName.c_str() ).c_str(), -1, SQLITE_STATIC ); SQLITE_STATIC tells SQLite that the string will outlive the statement handle. But in fact, you are passing a temporary buffer, de

Re: [sqlite] Weird issue with the query

2016-12-02 Thread Igor Korot
On Fri, Dec 2, 2016 at 6:56 PM, Igor Korot wrote: > Hi, ALL, > I wrote following code in C++ (error checking removed for clarity): > > [code] > const std::wstring &SQLiteDatabase::GetTableComments(const > std::wstring &tableName, std::vector &errorMsg) > { > std::wstring comment = L""; > s

[sqlite] Weird issue with the query

2016-12-02 Thread Igor Korot
Hi, ALL, I wrote following code in C++ (error checking removed for clarity): [code] const std::wstring &SQLiteDatabase::GetTableComments(const std::wstring &tableName, std::vector &errorMsg) { std::wstring comment = L""; sqlite3_stmt *stmt = NULL; std::wstring errorMessage; std::ws