Mike McCormack : msi: Add a test showing a join doesn't need a WHERE clause .
Module: wine Branch: master Commit: d65e80c85ed131b3899ecf2ba11aad738131de2f URL: http://source.winehq.org/git/wine.git/?a=commit;h=d65e80c85ed131b3899ecf2ba1... Author: Mike McCormack <mike(a)codeweavers.com> Date: Tue Oct 31 18:21:37 2006 +0900 msi: Add a test showing a join doesn't need a WHERE clause. --- dlls/msi/tests/db.c | 20 ++++++++++++++++++++ 1 files changed, 20 insertions(+), 0 deletions(-) diff --git a/dlls/msi/tests/db.c b/dlls/msi/tests/db.c index 85d5dba..c991ccd 100644 --- a/dlls/msi/tests/db.c +++ b/dlls/msi/tests/db.c @@ -2226,6 +2226,26 @@ static void test_join(void) MsiViewClose(hview); MsiCloseHandle(hview); + /* try a join without a WHERE condition */ + query = "SELECT `Component`.`ComponentId`, `FeatureComponents`.`Feature_` " + "FROM `Component`, `FeatureComponents` "; + r = MsiDatabaseOpenView(hdb, query, &hview); + ok( r == ERROR_SUCCESS, "failed to open view: %d\n", r ); + + r = MsiViewExecute(hview, 0); + ok( r == ERROR_SUCCESS, "failed to execute view: %d\n", r ); + + i = 0; + while ((r = MsiViewFetch(hview, &hrec)) == ERROR_SUCCESS) + { + i++; + MsiCloseHandle(hrec); + } + ok( i == 24, "Expected 24 rows, got %d\n", i ); + + MsiViewClose(hview); + MsiCloseHandle(hview); + query = "SELECT DISTINCT Component, ComponentId FROM FeatureComponents, Component " "WHERE FeatureComponents.Component_=Component.Component " "AND (Feature_='nasalis') ORDER BY Feature_";
participants (1)
-
Alexandre Julliard