# # # add_file "tests/t_db_init_info.at" # content [0456d20272cd74dfdba93d90cd3e25ff48dafe84] # # patch "ChangeLog" # from [c883ee33329cba2b22dd3617fd79ef756a336870] # to [b7c8a5c695712283f1ae58cb6944b24e7b5d00a4] # # patch "database.cc" # from [d23b26584ff2c0e3990ac9616a3e1bc58eefd665] # to [f8ef09fad03f4bd76708b9d42e05ad5a34320003] # # patch "testsuite.at" # from [0cfa0b8041e6430815f65965145117420a9b8110] # to [427e925670b88ebda1a0d5db0de633089b5467ad] # ============================================================ --- tests/t_db_init_info.at 0456d20272cd74dfdba93d90cd3e25ff48dafe84 +++ tests/t_db_init_info.at 0456d20272cd74dfdba93d90cd3e25ff48dafe84 @@ -0,0 +1,10 @@ +# -*- Autoconf -*- + +AT_SETUP([db info of new database]) +MTN_SETUP + +# check that db info of a new database works + +AT_CHECK(MTN db info, [], [ignore], [ignore]) + +AT_CLEANUP ============================================================ --- ChangeLog c883ee33329cba2b22dd3617fd79ef756a336870 +++ ChangeLog b7c8a5c695712283f1ae58cb6944b24e7b5d00a4 @@ -1,3 +1,10 @@ +2006-05-14 Derek Scherger + + * database.cc (info): allow any number of rows to be returned from + query of next_roster_node_number + * tests/t_db_init_info.at: new test of info on a new database + * testsuite.at: call it + 2006-05-12 Derek Scherger * testsuite.at (test_hooks.lua): ignore testsuite.log files ============================================================ --- database.cc d23b26584ff2c0e3990ac9616a3e1bc58eefd665 +++ database.cc f8ef09fad03f4bd76708b9d42e05ad5a34320003 @@ -538,11 +538,14 @@ u64 num_nodes; { results res; - fetch(res, one_col, one_row, query("SELECT node FROM next_roster_node_number")); + fetch(res, one_col, any_rows, query("SELECT node FROM next_roster_node_number")); if (res.empty()) num_nodes = 0; else - num_nodes = lexical_cast(res[0][0]) - 1; + { + I(res.size() == 1); + num_nodes = lexical_cast(res[0][0]) - 1; + } } #define SPACE_USAGE(TABLE, COLS) add(space_usage(TABLE, COLS), total) ============================================================ --- testsuite.at 0cfa0b8041e6430815f65965145117420a9b8110 +++ testsuite.at 427e925670b88ebda1a0d5db0de633089b5467ad @@ -887,3 +887,4 @@ m4_include(tests/t_escaped_selectors.at) m4_include(tests/t_automate_get_base_revision_id.at) m4_include(tests/t_automate_get_current_revision_id.at) +m4_include(tests/t_db_init_info.at)