You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

520 regels
22 KiB

  1. #include <cpphibernate/driver/mariadb.h>
  2. #include "test_helper.h"
  3. #include "test_schema.h"
  4. #include "mariadb_mock.h"
  5. using namespace ::testing;
  6. using namespace ::cpphibernate;
  7. TEST(CppHibernateTests, create_test1)
  8. {
  9. StrictMock<mariadb_mock> mock;
  10. expect_query(mock, "START TRANSACTION");
  11. expect_query(mock, "SELECT Uuid()", result_used({
  12. { "3d12697a-abb9-11e8-98d0-529269fb1459" }
  13. }));
  14. expect_query(mock, "INSERT INTO "
  15. "`tbl_test1` "
  16. "SET "
  17. "`tbl_test1_id`=UuidToBin('X3d12697a-abb9-11e8-98d0-529269fb1459X'), "
  18. "`str_data`='Xstr_data of class `test1` object `t1`X', "
  19. "`str64_data`='Xstr64_data of class `test1` object `t1`X', "
  20. "`u32_nullable`=null, "
  21. "`u32_ptr_u`='X456X', "
  22. "`u32_ptr_s`='X789X'",
  23. result_affected_rows(1));
  24. expect_query(mock, "COMMIT");
  25. EXPECT_CALL(
  26. mock,
  27. mysql_real_escape_string(reinterpret_cast<MYSQL*>(0x1111), _, _, _))
  28. .Times(AnyNumber())
  29. .WillRepeatedly(WithArgs<1, 2, 3>(EscapeString()));
  30. EXPECT_CALL(
  31. mock,
  32. mysql_close(
  33. reinterpret_cast<MYSQL*>(0x1111)));
  34. test1 t1;
  35. t1.str_data = "str_data of class `test1` object `t1`";
  36. t1.str64_data = "str64_data of class `test1` object `t1`";
  37. t1.u32_ptr_u = std::make_unique<uint32_t>(456);
  38. t1.u32_ptr_s = std::make_shared<uint32_t>(789);
  39. ::cppmariadb::connection connection(reinterpret_cast<MYSQL*>(0x1111));
  40. auto context = make_context<driver::mariadb>(test_schema, connection);
  41. context.create(t1);
  42. }
  43. TEST(CppHibernateTests, create_test2)
  44. {
  45. StrictMock<mariadb_mock> mock;
  46. expect_query(mock, "START TRANSACTION");
  47. expect_query(mock, "SELECT Uuid()", result_used({
  48. { "3d1270dc-abb9-11e8-98d0-529269fb1459" }
  49. }));
  50. expect_query(mock, "INSERT INTO "
  51. "`tbl_test2` "
  52. "SET "
  53. "`tbl_test2_id`=UuidToBin('X3d1270dc-abb9-11e8-98d0-529269fb1459X'), "
  54. "`u8_data`='X1X', "
  55. "`i8_data`='X2X', "
  56. "`u16_data`='X3X', "
  57. "`i16_data`='X4X'",
  58. result_affected_rows(1));
  59. expect_query(mock, "COMMIT");
  60. EXPECT_CALL(
  61. mock,
  62. mysql_real_escape_string(reinterpret_cast<MYSQL*>(0x1111), _, _, _))
  63. .Times(AnyNumber())
  64. .WillRepeatedly(WithArgs<1, 2, 3>(EscapeString()));
  65. EXPECT_CALL(
  66. mock,
  67. mysql_close(
  68. reinterpret_cast<MYSQL*>(0x1111)));
  69. test2 t2;
  70. t2.u8_data = 1;
  71. t2.i8_data = 2;
  72. t2.u16_data = 3;
  73. t2.i16_data = 4;
  74. ::cppmariadb::connection connection(reinterpret_cast<MYSQL*>(0x1111));
  75. auto context = make_context<driver::mariadb>(test_schema, connection);
  76. context.create(t2);
  77. }
  78. TEST(CppHibernateTests, create_test3)
  79. {
  80. StrictMock<mariadb_mock> mock;
  81. expect_query(mock, "START TRANSACTION");
  82. expect_query(mock, "SELECT Uuid()", result_used({
  83. { "3d12737a-abb9-11e8-98d0-529269fb1459" }
  84. }));
  85. expect_query(mock, "INSERT INTO "
  86. "`tbl_test3` "
  87. "SET "
  88. "`tbl_test3_id`=UuidToBin('X3d12737a-abb9-11e8-98d0-529269fb1459X'), "
  89. "`tbl_derived3_id_test3_list`=UuidToBin(null), "
  90. "`tbl_derived3_index_test3_list`='X0X', "
  91. "`tbl_derived3_id_test3_vector`=UuidToBin(null), "
  92. "`tbl_derived3_index_test3_vector`='X0X', "
  93. "`u32_data`='X5X', "
  94. "`i32_data`='X6X', "
  95. "`u64_data`='X7X', "
  96. "`i64_data`='X8X'",
  97. result_affected_rows(1));
  98. expect_query(mock, "COMMIT");
  99. EXPECT_CALL(
  100. mock,
  101. mysql_real_escape_string(reinterpret_cast<MYSQL*>(0x1111), _, _, _))
  102. .Times(AnyNumber())
  103. .WillRepeatedly(WithArgs<1, 2, 3>(EscapeString()));
  104. EXPECT_CALL(
  105. mock,
  106. mysql_close(
  107. reinterpret_cast<MYSQL*>(0x1111)));
  108. test3 t3;
  109. t3.u32_data = 5;
  110. t3.i32_data = 6;
  111. t3.u64_data = 7;
  112. t3.i64_data = 8;
  113. ::cppmariadb::connection connection(reinterpret_cast<MYSQL*>(0x1111));
  114. auto context = make_context<driver::mariadb>(test_schema, connection);
  115. context.create(t3);
  116. }
  117. TEST(CppHibernateTests, create_derived1)
  118. {
  119. StrictMock<mariadb_mock> mock;
  120. expect_query(mock, "START TRANSACTION");
  121. expect_query(mock, "SELECT Uuid()", result_used({
  122. { "3d12758c-abb9-11e8-98d0-529269fb1459" }
  123. }));
  124. expect_query(mock, "SELECT Uuid()", result_used({
  125. { "3d12778a-abb9-11e8-98d0-529269fb1459" }
  126. }));
  127. expect_query(mock, "INSERT INTO "
  128. "`tbl_base` "
  129. "SET "
  130. "`tbl_base_id`=UuidToBin('X3d12778a-abb9-11e8-98d0-529269fb1459X'), "
  131. "`name`='Xderived1X', "
  132. "`__type`='X11X'",
  133. result_affected_rows(1));
  134. expect_query(mock, "SELECT Uuid()", result_used({
  135. { "3d127988-abb9-11e8-98d0-529269fb1459" }
  136. }));
  137. expect_query(mock, "INSERT INTO "
  138. "`tbl_test1` "
  139. "SET "
  140. "`tbl_test1_id`=UuidToBin('X3d127988-abb9-11e8-98d0-529269fb1459X'), "
  141. "`str_data`='Xstr_data of class `test1` object `d1.test1_data`X', "
  142. "`str64_data`='Xstr64_data of class `test1` object `d1.test1_data`X', "
  143. "`u32_nullable`='X32X', "
  144. "`u32_ptr_u`=null, "
  145. "`u32_ptr_s`='X789X'",
  146. result_affected_rows(1));
  147. expect_query(mock, "INSERT INTO "
  148. "`tbl_derived1` "
  149. "SET "
  150. "`tbl_derived1_id`=UuidToBin('X3d12758c-abb9-11e8-98d0-529269fb1459X'), "
  151. "`tbl_base_id`=UuidToBin('X3d12778a-abb9-11e8-98d0-529269fb1459X'), "
  152. "`tbl_test1_id_test1_data`=UuidToBin('X3d127988-abb9-11e8-98d0-529269fb1459X'), "
  153. "`enum_data`='Xtest2X'",
  154. result_affected_rows(1));
  155. expect_query(mock, "COMMIT");
  156. EXPECT_CALL(
  157. mock,
  158. mysql_real_escape_string(reinterpret_cast<MYSQL*>(0x1111), _, _, _))
  159. .Times(AnyNumber())
  160. .WillRepeatedly(WithArgs<1, 2, 3>(EscapeString()));
  161. EXPECT_CALL(
  162. mock,
  163. mysql_close(
  164. reinterpret_cast<MYSQL*>(0x1111)));
  165. derived1 d1;
  166. d1.name = "derived1";
  167. d1.enum_data = test_enum::test2;
  168. d1.test1_data.str_data = "str_data of class `test1` object `d1.test1_data`";
  169. d1.test1_data.str64_data = "str64_data of class `test1` object `d1.test1_data`";
  170. d1.test1_data.u32_nullable = 32;
  171. d1.test1_data.u32_ptr_s = std::make_shared<uint32_t>(789);
  172. ::cppmariadb::connection connection(reinterpret_cast<MYSQL*>(0x1111));
  173. auto context = make_context<driver::mariadb>(test_schema, connection);
  174. context.create(static_cast<base&>(d1));
  175. }
  176. TEST(CppHibernateTests, create_derived2)
  177. {
  178. StrictMock<mariadb_mock> mock;
  179. expect_query(mock, "START TRANSACTION");
  180. expect_query(mock, "SELECT Uuid()", result_used({
  181. { "3d127bcc-abb9-11e8-98d0-529269fb1459" }
  182. }));
  183. expect_query(mock, "SELECT Uuid()", result_used({
  184. { "3d127db6-abb9-11e8-98d0-529269fb1459" }
  185. }));
  186. expect_query(mock, "INSERT INTO "
  187. "`tbl_base` "
  188. "SET "
  189. "`tbl_base_id`=UuidToBin('X3d127db6-abb9-11e8-98d0-529269fb1459X'), "
  190. "`name`='Xderived2X', "
  191. "`__type`='X12X'",
  192. result_affected_rows(1));
  193. expect_query(mock, "SELECT Uuid()", result_used({
  194. { "3d1283a6-abb9-11e8-98d0-529269fb1459" }
  195. }));
  196. expect_query(mock, "INSERT INTO "
  197. "`tbl_test2` "
  198. "SET "
  199. "`tbl_test2_id`=UuidToBin('X3d1283a6-abb9-11e8-98d0-529269fb1459X'), "
  200. "`u8_data`='X10X', "
  201. "`i8_data`='X11X', "
  202. "`u16_data`='X12X', "
  203. "`i16_data`='X13X'",
  204. result_affected_rows(1));
  205. expect_query(mock, "SELECT Uuid()", result_used({
  206. { "3d128522-abb9-11e8-98d0-529269fb1459" }
  207. }));
  208. expect_query(mock, "INSERT INTO "
  209. "`tbl_test2` "
  210. "SET "
  211. "`tbl_test2_id`=UuidToBin('X3d128522-abb9-11e8-98d0-529269fb1459X'), "
  212. "`u8_data`='X20X', "
  213. "`i8_data`='X21X', "
  214. "`u16_data`='X22X', "
  215. "`i16_data`='X23X'",
  216. result_affected_rows(1));
  217. expect_query(mock, "INSERT INTO "
  218. "`tbl_derived2` "
  219. "SET "
  220. "`tbl_derived2_id`=UuidToBin('X3d127bcc-abb9-11e8-98d0-529269fb1459X'), "
  221. "`tbl_base_id`=UuidToBin('X3d127db6-abb9-11e8-98d0-529269fb1459X'), "
  222. "`tbl_test2_id_test2_nullable`=UuidToBin('X3d1283a6-abb9-11e8-98d0-529269fb1459X'), "
  223. "`tbl_test2_id_test2_ptr_u`=UuidToBin('X3d128522-abb9-11e8-98d0-529269fb1459X'), "
  224. "`tbl_test2_id_test2_ptr_s`=UuidToBin(null)",
  225. result_affected_rows(1));
  226. expect_query(mock, "COMMIT");
  227. EXPECT_CALL(
  228. mock,
  229. mysql_real_escape_string(reinterpret_cast<MYSQL*>(0x1111), _, _, _))
  230. .Times(AnyNumber())
  231. .WillRepeatedly(WithArgs<1, 2, 3>(EscapeString()));
  232. EXPECT_CALL(
  233. mock,
  234. mysql_close(
  235. reinterpret_cast<MYSQL*>(0x1111)));
  236. derived2 d2;
  237. d2.name = "derived2";
  238. d2.test2_nullable = test2 { };
  239. d2.test2_nullable->u8_data = 10;
  240. d2.test2_nullable->i8_data = 11;
  241. d2.test2_nullable->u16_data = 12;
  242. d2.test2_nullable->i16_data = 13;
  243. d2.test2_ptr_u = std::make_unique<test2>();
  244. d2.test2_ptr_u->u8_data = 20;
  245. d2.test2_ptr_u->i8_data = 21;
  246. d2.test2_ptr_u->u16_data = 22;
  247. d2.test2_ptr_u->i16_data = 23;
  248. ::cppmariadb::connection connection(reinterpret_cast<MYSQL*>(0x1111));
  249. auto context = make_context<driver::mariadb>(test_schema, connection);
  250. context.create(static_cast<base&>(d2));
  251. }
  252. TEST(CppHibernateTests, create_derived3)
  253. {
  254. StrictMock<mariadb_mock> mock;
  255. expect_query(mock, "START TRANSACTION");
  256. expect_query(mock, "SELECT Uuid()", result_used({
  257. { "3d12866c-abb9-11e8-98d0-529269fb1459" }
  258. }));
  259. expect_query(mock, "SELECT Uuid()", result_used({
  260. { "3d1287a2-abb9-11e8-98d0-529269fb1459" }
  261. }));
  262. expect_query(mock, "SELECT Uuid()", result_used({
  263. { "3d1288ce-abb9-11e8-98d0-529269fb1459" }
  264. }));
  265. expect_query(mock, "INSERT INTO "
  266. "`tbl_base` "
  267. "SET "
  268. "`tbl_base_id`=UuidToBin('X3d1288ce-abb9-11e8-98d0-529269fb1459X'), "
  269. "`name`='Xderived3X', "
  270. "`__type`='X13X'",
  271. result_affected_rows(1));
  272. expect_query(mock, "INSERT INTO "
  273. "`tbl_derived2` "
  274. "SET "
  275. "`tbl_derived2_id`=UuidToBin('X3d1287a2-abb9-11e8-98d0-529269fb1459X'), "
  276. "`tbl_base_id`=UuidToBin('X3d1288ce-abb9-11e8-98d0-529269fb1459X'), "
  277. "`tbl_test2_id_test2_nullable`=UuidToBin(null), "
  278. "`tbl_test2_id_test2_ptr_u`=UuidToBin(null), "
  279. "`tbl_test2_id_test2_ptr_s`=UuidToBin(null)",
  280. result_affected_rows(1));
  281. expect_query(mock, "INSERT INTO "
  282. "`tbl_derived3` "
  283. "SET "
  284. "`tbl_derived3_id`=UuidToBin('X3d12866c-abb9-11e8-98d0-529269fb1459X'), "
  285. "`tbl_derived2_id`=UuidToBin('X3d1287a2-abb9-11e8-98d0-529269fb1459X')",
  286. result_affected_rows(1));
  287. expect_query(mock, "SELECT Uuid()", result_used({
  288. { "3d1289f0-abb9-11e8-98d0-529269fb1459" }
  289. }));
  290. expect_query(mock, "INSERT INTO "
  291. "`tbl_test3` "
  292. "SET "
  293. "`tbl_test3_id`=UuidToBin('X3d1289f0-abb9-11e8-98d0-529269fb1459X'), "
  294. "`tbl_derived3_id_test3_list`=UuidToBin('X3d12866c-abb9-11e8-98d0-529269fb1459X'), "
  295. "`tbl_derived3_index_test3_list`='X0X', "
  296. "`tbl_derived3_id_test3_vector`=UuidToBin(null), "
  297. "`tbl_derived3_index_test3_vector`='X0X', "
  298. "`u32_data`='X100X', "
  299. "`i32_data`='X101X', "
  300. "`u64_data`='X102X', "
  301. "`i64_data`='X103X'",
  302. result_affected_rows(1));
  303. expect_query(mock, "SELECT Uuid()", result_used({
  304. { "3d128b26-abb9-11e8-98d0-529269fb1459" }
  305. }));
  306. expect_query(mock, "INSERT INTO "
  307. "`tbl_test3` "
  308. "SET "
  309. "`tbl_test3_id`=UuidToBin('X3d128b26-abb9-11e8-98d0-529269fb1459X'), "
  310. "`tbl_derived3_id_test3_list`=UuidToBin('X3d12866c-abb9-11e8-98d0-529269fb1459X'), "
  311. "`tbl_derived3_index_test3_list`='X1X', "
  312. "`tbl_derived3_id_test3_vector`=UuidToBin(null), "
  313. "`tbl_derived3_index_test3_vector`='X0X', "
  314. "`u32_data`='X110X', "
  315. "`i32_data`='X111X', "
  316. "`u64_data`='X112X', "
  317. "`i64_data`='X113X'",
  318. result_affected_rows(1));
  319. expect_query(mock, "SELECT Uuid()", result_used({
  320. { "3d128eb4-abb9-11e8-98d0-529269fb1459" }
  321. }));
  322. expect_query(mock, "INSERT INTO "
  323. "`tbl_test3` "
  324. "SET "
  325. "`tbl_test3_id`=UuidToBin('X3d128eb4-abb9-11e8-98d0-529269fb1459X'), "
  326. "`tbl_derived3_id_test3_list`=UuidToBin(null), "
  327. "`tbl_derived3_index_test3_list`='X0X', "
  328. "`tbl_derived3_id_test3_vector`=UuidToBin('X3d12866c-abb9-11e8-98d0-529269fb1459X'), "
  329. "`tbl_derived3_index_test3_vector`='X0X', "
  330. "`u32_data`='X200X', "
  331. "`i32_data`='X201X', "
  332. "`u64_data`='X202X', "
  333. "`i64_data`='X203X'",
  334. result_affected_rows(1));
  335. expect_query(mock, "SELECT Uuid()", result_used({
  336. { "3d128ffe-abb9-11e8-98d0-529269fb1459" }
  337. }));
  338. expect_query(mock, "INSERT INTO "
  339. "`tbl_test3` "
  340. "SET "
  341. "`tbl_test3_id`=UuidToBin('X3d128ffe-abb9-11e8-98d0-529269fb1459X'), "
  342. "`tbl_derived3_id_test3_list`=UuidToBin(null), "
  343. "`tbl_derived3_index_test3_list`='X0X', "
  344. "`tbl_derived3_id_test3_vector`=UuidToBin('X3d12866c-abb9-11e8-98d0-529269fb1459X'), "
  345. "`tbl_derived3_index_test3_vector`='X1X', "
  346. "`u32_data`='X210X', "
  347. "`i32_data`='X211X', "
  348. "`u64_data`='X212X', "
  349. "`i64_data`='X213X'",
  350. result_affected_rows(1));
  351. expect_query(mock, "SELECT Uuid()", result_used({
  352. { "3d129134-abb9-11e8-98d0-529269fb1459" }
  353. }));
  354. expect_query(mock, "INSERT INTO "
  355. "`tbl_test3` "
  356. "SET "
  357. "`tbl_test3_id`=UuidToBin('X3d129134-abb9-11e8-98d0-529269fb1459X'), "
  358. "`tbl_derived3_id_test3_list`=UuidToBin(null), "
  359. "`tbl_derived3_index_test3_list`='X0X', "
  360. "`tbl_derived3_id_test3_vector`=UuidToBin('X3d12866c-abb9-11e8-98d0-529269fb1459X'), "
  361. "`tbl_derived3_index_test3_vector`='X2X', "
  362. "`u32_data`='X220X', "
  363. "`i32_data`='X221X', "
  364. "`u64_data`='X222X', "
  365. "`i64_data`='X223X'",
  366. result_affected_rows(1));
  367. expect_query(mock, "COMMIT");
  368. EXPECT_CALL(
  369. mock,
  370. mysql_real_escape_string(reinterpret_cast<MYSQL*>(0x1111), _, _, _))
  371. .Times(AnyNumber())
  372. .WillRepeatedly(WithArgs<1, 2, 3>(EscapeString()));
  373. EXPECT_CALL(
  374. mock,
  375. mysql_close(
  376. reinterpret_cast<MYSQL*>(0x1111)));
  377. derived3 d3;
  378. d3.name = "derived3";
  379. d3.test3_list.emplace_back();
  380. d3.test3_list.back().u32_data = 100;
  381. d3.test3_list.back().i32_data = 101;
  382. d3.test3_list.back().u64_data = 102;
  383. d3.test3_list.back().i64_data = 103;
  384. d3.test3_list.emplace_back();
  385. d3.test3_list.back().u32_data = 110;
  386. d3.test3_list.back().i32_data = 111;
  387. d3.test3_list.back().u64_data = 112;
  388. d3.test3_list.back().i64_data = 113;
  389. d3.test3_vector.emplace_back();
  390. d3.test3_vector.back().u32_data = 200;
  391. d3.test3_vector.back().i32_data = 201;
  392. d3.test3_vector.back().u64_data = 202;
  393. d3.test3_vector.back().i64_data = 203;
  394. d3.test3_vector.emplace_back();
  395. d3.test3_vector.back().u32_data = 210;
  396. d3.test3_vector.back().i32_data = 211;
  397. d3.test3_vector.back().u64_data = 212;
  398. d3.test3_vector.back().i64_data = 213;
  399. d3.test3_vector.emplace_back();
  400. d3.test3_vector.back().u32_data = 220;
  401. d3.test3_vector.back().i32_data = 221;
  402. d3.test3_vector.back().u64_data = 222;
  403. d3.test3_vector.back().i64_data = 223;
  404. ::cppmariadb::connection connection(reinterpret_cast<MYSQL*>(0x1111));
  405. auto context = make_context<driver::mariadb>(test_schema, connection);
  406. context.create(static_cast<derived2&>(d3));
  407. }
  408. TEST(CppHibernateTests, create_dummy_owner)
  409. {
  410. StrictMock<mariadb_mock> mock;
  411. expect_query(mock, "START TRANSACTION");
  412. expect_query(mock, "SELECT Uuid()", result_used({
  413. { "00000000-0000-0000-0000-000000000001" }
  414. }));
  415. expect_query(mock, "INSERT INTO "
  416. "`tbl_dummy_owner` "
  417. "SET "
  418. "`tbl_dummy_owner_id`=UuidToBin('X00000000-0000-0000-0000-000000000001X')",
  419. result_affected_rows(1));
  420. expect_query(mock, "SELECT Uuid()", result_used({
  421. { "00000000-0000-0000-0001-000000000001" }
  422. }));
  423. expect_query(mock, "INSERT INTO "
  424. "`tbl_dummy_id` "
  425. "SET "
  426. "`tbl_dummy_id_id`=UuidToBin('X00000000-0000-0000-0001-000000000001X'), "
  427. "`tbl_dummy_owner_id_dummies`=UuidToBin('X00000000-0000-0000-0000-000000000001X'), "
  428. "`tbl_dummy_owner_index_dummies`='X0X', "
  429. "`data`='X123X'",
  430. result_affected_rows(1));
  431. expect_query(mock, "SELECT Uuid()", result_used({
  432. { "00000000-0000-0000-0001-000000000002" }
  433. }));
  434. expect_query(mock, "INSERT INTO "
  435. "`tbl_dummy_id` "
  436. "SET "
  437. "`tbl_dummy_id_id`=UuidToBin('X00000000-0000-0000-0001-000000000002X'), "
  438. "`tbl_dummy_owner_id_dummies`=UuidToBin('X00000000-0000-0000-0000-000000000001X'), "
  439. "`tbl_dummy_owner_index_dummies`='X1X', "
  440. "`data`='X456X'",
  441. result_affected_rows(1));
  442. expect_query(mock, "SELECT Uuid()", result_used({
  443. { "00000000-0000-0000-0001-000000000003" }
  444. }));
  445. expect_query(mock, "INSERT INTO "
  446. "`tbl_dummy_id` "
  447. "SET "
  448. "`tbl_dummy_id_id`=UuidToBin('X00000000-0000-0000-0001-000000000003X'), "
  449. "`tbl_dummy_owner_id_dummies`=UuidToBin('X00000000-0000-0000-0000-000000000001X'), "
  450. "`tbl_dummy_owner_index_dummies`='X2X', "
  451. "`data`='X789X'",
  452. result_affected_rows(1));
  453. expect_query(mock, "COMMIT");
  454. EXPECT_CALL(
  455. mock,
  456. mysql_real_escape_string(reinterpret_cast<MYSQL*>(0x1111), _, _, _))
  457. .Times(AnyNumber())
  458. .WillRepeatedly(WithArgs<1, 2, 3>(EscapeString()));
  459. EXPECT_CALL(
  460. mock,
  461. mysql_close(
  462. reinterpret_cast<MYSQL*>(0x1111)));
  463. dummy_owner d;
  464. d.dummies.emplace_back(123);
  465. d.dummies.emplace_back(456);
  466. d.dummies.emplace_back(789);
  467. ::cppmariadb::connection connection(reinterpret_cast<MYSQL*>(0x1111));
  468. auto context = make_context<driver::mariadb>(test_schema, connection);
  469. context.create(d);
  470. }