Comments (11)
AFAIU (@Krzmbrzl please correct me if I'm wrong), this never worked before, as you need a transaction in order to use LOBs with Oracle, but now this is more explicit.
IOW the fix is to have a transaction around the code working with LOBs.
from soci.
It worked at 047b749
from soci.
Could you please use git-bisect which exact commit broke it? I see 8b5b312 (Fix Oracle bug that prevented selecting into initialized BLOB, 2023-11-01) which might be related...
from soci.
Tbh I don't quite remember the exact semantics of Oracle. Iirc there were/are situations in which you didn't need an explicit transaction... it was a bit of an odd situation, that much I know π
It worked atΒ 047b749
@avpalienko "at" or "before"? Aka: is this the commit that broke it or is it the last commit for which this works as expected?
from soci.
I don't know - it works in my fork. Fork is based on 8ddddca
I try rebase to the last commit of master and found the problem
from soci.
Could you do a bisect to find the commit that causes the issue?
from soci.
Could you do a bisect to find the commit that causes the issue?
I'll try, but I have no experience with bisect. So it will take a while
from soci.
I found one more problem.
If rowset contains more than one row move_as() does access violation ( use after move )
diff --git a/tests/common-tests.h b/tests/common-tests.h
index d2b8fb42..ffc80fc6 100644
--- a/tests/common-tests.h
+++ b/tests/common-tests.h
@@ -6779,7 +6779,7 @@ TEST_CASE_METHOD(common_tests, "BLOB", "[core][blob]")
}
SECTION("move_as")
{
- soci::rowset< soci::row > rowSet = (sql.prepare << "select b from soci_test where id=:id", soci::use(id));
+ soci::rowset< soci::row > rowSet = (sql.prepare << "select b from soci_test where id=:id union all select b from soci_test where id=:id", soci::use(id, "id"));
bool containedData = false;
for (auto it = rowSet.begin(); it != rowSet.end(); ++it)
{
from soci.
If rowset contains more than one row move_as() does access violation ( use after move )
What do you mean by that? If you use move_as on the same element that is an obvious error on the user side but I have the feeling that's not what you're getting at π
(I don't understand the relation between what you've written and the parch you have provided)
from soci.
This patch demonstrates the problem. If it apply the test fails with access violation error
soci::rowset< soci::row > rowSet = (sql.prepare << "select b from soci_test where id=:id union all select b from soci_test where id=:id", soci::use(id, "id"));
bool containedData = false;
for (auto it = rowSet.begin(); it != rowSet.end(); ++it)
{
containedData = true;
const soci::row ¤tRow = *it;
soci::blob intoBlob = currentRow.move_as<soci::blob>(0);
at second iteration will error
Sorry for my bad English
from soci.
Thanks for the clarification. I have created a separate issue for this: #1144
from soci.
Related Issues (20)
- SOCI doesn't compile when using the `UNICODE` flag on Windows HOT 4
- Next release
- vcpkg soci crashes on session::close() HOT 1
- Streamline cmake usage HOT 14
- How to read DATETIME(3) type in database? HOT 2
- Missing backend includes HOT 2
- failed to connect to mysql database after I upgrade the mariadbclient library inside the msys2 HOT 2
- MSVC: number of sections exceeded object file format limit
- Issue with Boost 1.84 HOT 6
- Incorrect query result with `use` and `into` into vector, at least for sqlite3. HOT 1
- Incorrect query result with `use` and `into` into vector, at least for sqlite3. HOT 2
- SOCI with MySQL on Linux (Ubuntu) - impossible to link static HOT 12
- Dates before year 1900 stored in Oracle as one hundred years earlier. HOT 1
- Win10, sqlite3 , MultiThread , Can not use into and use . HOT 2
- Getting Invalid Cursor State on mssql - complex queries - Urgent help needed HOT 2
- Cant use sqlstate(). Undefined reference HOT 2
- Using `row::move_as` while iterating `rowset` yields segmentation fault HOT 3
- Question on how to convert empty std::tm to timestamp and convert back in a MySQL database HOT 2
- Memory Leak when trying to connect to Microsoft SQL Server HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from soci.