Commit 1582f580 authored by Mike McCormack's avatar Mike McCormack Committed by Alexandre Julliard

msi: Fix the join algorithm.

parent 6c95dc64
...@@ -172,13 +172,16 @@ static UINT join_match( UINT *ldata, UINT lcount, ...@@ -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++;
......
...@@ -2206,29 +2206,20 @@ static void test_join(void) ...@@ -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 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment