File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -1345,10 +1345,14 @@ void mysqlx::internal::BaseResult::init(mysqlx::internal::BaseResult &&init_)
1345
1345
1346
1346
m_sess = init_.m_sess ;
1347
1347
1348
- // first deregister init result, since it registered itself on ctor
1349
- // otherwise it would trigger cache, and we are moving Result object
1350
- m_sess->deregister_result (&init_);
1351
- m_sess->register_result (this );
1348
+ // On empty results, m_sess is NULL, so don't do anything with it!
1349
+ if (m_sess)
1350
+ {
1351
+ // first deregister init result, since it registered itself on ctor
1352
+ // otherwise it would trigger cache, and we are moving Result object
1353
+ m_sess->deregister_result (&init_);
1354
+ m_sess->register_result (this );
1355
+ }
1352
1356
1353
1357
}
1354
1358
Original file line number Diff line number Diff line change @@ -848,6 +848,13 @@ TEST_F(Crud, table)
848
848
849
849
std::vector<string> cols = {" _id" };
850
850
851
+ // Inserting empty list
852
+
853
+ // Bug #25515964
854
+ // Adding empty list shouldn't do anything
855
+ std::list<Row> rList;
856
+ tbl.insert (cols, " age" , string (" name" )).rows (rList).rows (rList).execute ();
857
+
851
858
// Using containers (vectors, const char* and string)
852
859
853
860
auto insert = tbl.insert (cols, " age" , string (" name" ));
You can’t perform that action at this time.
0 commit comments