msi: Fix the join algorithm.

This commit is contained in:
Mike McCormack 2006-10-26 18:29:52 +09:00 committed by Alexandre Julliard
parent 6c95dc644c
commit 1582f58036
2 changed files with 11 additions and 17 deletions

View File

@ -172,13 +172,16 @@ static UINT join_match( UINT *ldata, UINT lcount,
{ {
pairs[n*2] = ldata[i*2]; pairs[n*2] = ldata[i*2];
pairs[n*2+1] = rdata[j*2]; pairs[n*2+1] = rdata[j*2];
i++; /* FIXME: assumes primary key on the right */
n++; n++;
continue;
if ( ldata[i*2+3] < rdata[j*2+3])
i++;
else
j++;
} }
/* values differ... move along */ /* values differ... move along */
if (ldata[i*2+1] < rdata[j*2+1]) else if (ldata[i*2+1] < rdata[j*2+1])
i++; i++;
else else
j++; j++;

View File

@ -2206,29 +2206,20 @@ static void test_join(void)
size = MAX_PATH; size = MAX_PATH;
r = MsiRecordGetString( hrec, 1, buf, &size ); r = MsiRecordGetString( hrec, 1, buf, &size );
ok( r == ERROR_SUCCESS, "failed to get record string: %d\n", r ); ok( r == ERROR_SUCCESS, "failed to get record string: %d\n", r );
if (i == 2 || i == 3) todo_wine
{
ok( !lstrcmp( buf, join_res_first[i].one ), ok( !lstrcmp( buf, join_res_first[i].one ),
"For (row %d, column 1) expected '%s', got %s\n", i, join_res_first[i].one, buf ); "For (row %d, column 1) expected '%s', got %s\n", i, join_res_first[i].one, buf );
}
size = MAX_PATH; size = MAX_PATH;
r = MsiRecordGetString( hrec, 2, buf, &size ); r = MsiRecordGetString( hrec, 2, buf, &size );
ok( r == ERROR_SUCCESS, "failed to get record string: %d\n", r ); ok( r == ERROR_SUCCESS, "failed to get record string: %d\n", r );
if (i == 3) todo_wine
{
ok( !lstrcmp( buf, join_res_first[i].two ), ok( !lstrcmp( buf, join_res_first[i].two ),
"For (row %d, column 2) expected '%s', got %s\n", i, join_res_first[i].two, buf ); "For (row %d, column 2) expected '%s', got %s\n", i, join_res_first[i].two, buf );
}
i++; i++;
MsiCloseHandle(hrec); MsiCloseHandle(hrec);
} }
todo_wine
{
ok( i == 5, "Expected 5 rows, got %d\n", i ); ok( i == 5, "Expected 5 rows, got %d\n", i );
}
ok( r == ERROR_NO_MORE_ITEMS, "expected no more items: %d\n", r ); ok( r == ERROR_NO_MORE_ITEMS, "expected no more items: %d\n", r );