@@ -594,7 +594,6 @@ bool Client::buzzHouse()
594594 fuzz_config->loadServerConfigurations ();
595595 loadFuzzerServerSettings (*fuzz_config);
596596 loadFuzzerTableSettings (*fuzz_config);
597- loadFuzzerOracleSettings (*fuzz_config);
598597 loadSystemTables (*fuzz_config);
599598
600599 full_query2.reserve (8192 );
@@ -633,9 +632,8 @@ bool Client::buzzHouse()
633632 {
634633 const uint32_t correctness_oracle = 30 ;
635634 const uint32_t settings_oracle = 30 ;
636- const uint32_t dump_oracle = 15
637- * static_cast <uint32_t >(fuzz_config->use_dump_table_oracle
638- && gen.collectionHas <BuzzHouse::SQLTable>(gen.attached_tables_for_dump_table_oracle ));
635+ const uint32_t dump_oracle
636+ = 30 * static_cast <uint32_t >(gen.collectionHas <BuzzHouse::SQLTable>(gen.attached_tables_to_test_format ));
639637 const uint32_t peer_oracle
640638 = 30 * static_cast <uint32_t >(gen.collectionHas <BuzzHouse::SQLTable>(gen.attached_tables_for_table_peer_oracle ));
641639 const uint32_t run_query = 910 ;
@@ -695,43 +693,62 @@ bool Client::buzzHouse()
695693 }
696694 else if (dump_oracle && nopt < (correctness_oracle + settings_oracle + dump_oracle + 1 ))
697695 {
698- const BuzzHouse::SQLTable & t
699- = rg.pickRandomly (gen.filterCollection <BuzzHouse::SQLTable>(gen.attached_tables_for_dump_table_oracle ));
700-
701696 // / Test in and out formats
702- full_query2.resize (0 );
703- qo.dumpTableContent (rg, gen, t, sq1);
704- BuzzHouse::SQLQueryToString (full_query2, sq1);
705- outf << full_query2 << std::endl;
706- server_up &= processBuzzHouseQuery (full_query2);
707- qo.processFirstOracleQueryResult (!have_error, *external_integrations);
697+ // / When testing content, we have to export and import to the same table
698+ const bool test_content = fuzz_config->dump_table_oracle_compare_content && rg.nextBool ()
699+ && gen.collectionHas <BuzzHouse::SQLTable>(gen.attached_tables_to_compare_content );
700+ const auto & t1 = rg.pickRandomly (gen.filterCollection <BuzzHouse::SQLTable>(
701+ test_content ? gen.attached_tables_to_compare_content : gen.attached_tables_to_test_format ));
702+ const auto & t2 = test_content
703+ ? t1
704+ : rg.pickRandomly (gen.filterCollection <BuzzHouse::SQLTable>(gen.attached_tables_to_test_format ));
705+
706+ if (test_content)
707+ {
708+ // / Dump table content and read it later to look for correctness
709+ full_query2.resize (0 );
710+ qo.dumpTableContent (rg, gen, t1, sq1);
711+ BuzzHouse::SQLQueryToString (full_query2, sq1);
712+ outf << full_query2 << std::endl;
713+ server_up &= processBuzzHouseQuery (full_query2);
714+ qo.processFirstOracleQueryResult (!have_error, *external_integrations);
715+ }
708716
709717 sq2.Clear ();
710- qo.generateExportQuery (rg, gen, t , sq2);
718+ qo.generateExportQuery (rg, gen, test_content, t1 , sq2);
711719 BuzzHouse::SQLQueryToString (full_query, sq2);
712720 outf << full_query << std::endl;
713721 server_up &= processBuzzHouseQuery (full_query);
714- qo.setIntermediateStepSuccess (!have_error);
715722
716- sq3.Clear ();
717- full_query.resize (0 );
718- qo.generateClearQuery (t, sq3);
719- BuzzHouse::SQLQueryToString (full_query, sq3);
720- outf << full_query << std::endl;
721- server_up &= processBuzzHouseQuery (full_query);
722- qo.setIntermediateStepSuccess (!have_error);
723+ if (test_content)
724+ {
725+ // / Clear table, before inserting data again, when testing for correctness
726+ qo.setIntermediateStepSuccess (!have_error);
727+
728+ sq3.Clear ();
729+ full_query.resize (0 );
730+ qo.generateClearQuery (t1, sq3);
731+ BuzzHouse::SQLQueryToString (full_query, sq3);
732+ outf << full_query << std::endl;
733+ server_up &= processBuzzHouseQuery (full_query);
734+ qo.setIntermediateStepSuccess (!have_error);
735+ }
723736
724737 sq4.Clear ();
725738 full_query.resize (0 );
726- qo.generateImportQuery (rg, gen, t , sq2, sq4);
739+ qo.generateImportQuery (rg, gen, t2 , sq2, sq4);
727740 BuzzHouse::SQLQueryToString (full_query, sq4);
728741 outf << full_query << std::endl;
729742 server_up &= processBuzzHouseQuery (full_query);
730- qo.setIntermediateStepSuccess (!have_error);
731743
732- outf << full_query2 << std::endl;
733- server_up &= processBuzzHouseQuery (full_query2);
734- qo.processSecondOracleQueryResult (!have_error, *external_integrations, " Dump and read table" );
744+ if (test_content)
745+ {
746+ qo.setIntermediateStepSuccess (!have_error);
747+
748+ outf << full_query2 << std::endl;
749+ server_up &= processBuzzHouseQuery (full_query2);
750+ qo.processSecondOracleQueryResult (!have_error, *external_integrations, " Dump and read table" );
751+ }
735752 }
736753 else if (peer_oracle && nopt < (correctness_oracle + settings_oracle + dump_oracle + peer_oracle + 1 ))
737754 {
0 commit comments