diff options
author | Michael Cahill <michael.cahill@wiredtiger.com> | 2011-10-06 14:25:27 +1100 |
---|---|---|
committer | Michael Cahill <michael.cahill@wiredtiger.com> | 2011-10-06 14:25:27 +1100 |
commit | e78bcf9a86027dae388d0cded6789e7b932e53c2 (patch) | |
tree | 0336d2cbc0a86694bd28203814caff419f1992a4 /examples/c/ex_schema.c | |
parent | 9fc8c8d60beeeab0fce1aeef79c53bad2d55e287 (diff) | |
download | mongo-e78bcf9a86027dae388d0cded6789e7b932e53c2.tar.gz |
Run example programs as part of automated testing, fix bugs.
closes #117
Diffstat (limited to 'examples/c/ex_schema.c')
-rw-r--r-- | examples/c/ex_schema.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/examples/c/ex_schema.c b/examples/c/ex_schema.c index 2297e6bbdf8..1d18208fc4a 100644 --- a/examples/c/ex_schema.c +++ b/examples/c/ex_schema.c @@ -65,8 +65,18 @@ int main(void) "key_format=r," "value_format=5sHQ," "columns=(id,country,year,population)," - "colgroup.population=(population)," - "index.country_year=(country,year)"); + "colgroups=(main,population)"); + + /* Create the column groups to store population in its own file. */ + ret = session->create(session, "colgroup:population:main", + "columns=(country,year)"); + + ret = session->create(session, "colgroup:population:population", + "columns=(population)"); + + /* Create an index with composite key (country,year). */ + ret = session->create(session, "index:population:country_year", + "columns=(country,year)"); ret = session->open_cursor(session, "table:population", NULL, NULL, &cursor); @@ -80,7 +90,7 @@ int main(void) /* Now just read through the countries we know about */ ret = session->open_cursor(session, - "index:population.country_year(country,id)", + "index:population:country_year(country,id)", NULL, NULL, &cursor); while ((ret = cursor->next(cursor)) == 0) { |