Код: Выделить всё
t.insert().values(0, "cng", "CNG").execute(); // Works as expected
t.insert("code", "name").values("cng", "CNG").execute(); // Also works
Код: Выделить всё
mysqlx::abi2::Row row1;
row1.set(1, 0);
row1.set(2, "cng");
row1.set(3, "CNG");
// t.insert().values(row1).execute(); // terminate called after throwing an instance of 'std::out_of_range'
// what(): no meta-data found
// t.insert().rows(row1).execute(); // terminate called after throwing an instance of 'std::out_of_range'
// what(): no meta-data found
Для справки: следующий код (который противоречит цели из-за необходимости указывать имена столбцов, которые я не знаю во время компиляции) также терпит неудачу с тем же исключением:
Код: Выделить всё
mysqlx::abi2::Row row2;
row2.set(1, "cng");
row2.set(2, "CNG");
// t.insert("code", "name").values(row2).execute(); // terminate called after throwing an instance of 'std::out_of_range'
// what(): no meta-data found
// t.insert("code", "name").rows(row2).execute(); // terminate called after throwing an instance of 'std::out_of_range'
// what(): no meta-data found
Подробнее здесь: https://stackoverflow.com/questions/787 ... ound-error