Commit 9dddb94b authored by Hib Eris's avatar Hib Eris Committed by Alexandre Julliard

msi: Fix merging string type checks.

parent 925fb3b4
...@@ -1081,6 +1081,19 @@ typedef struct _tagMERGEDATA ...@@ -1081,6 +1081,19 @@ typedef struct _tagMERGEDATA
struct list *tabledata; struct list *tabledata;
} MERGEDATA; } MERGEDATA;
static BOOL merge_type_match(LPCWSTR type1, LPCWSTR type2)
{
if (((type1[0] == 'l') || (type1[0] == 's')) &&
((type2[0] == 'l') || (type2[0] == 's')))
return TRUE;
if (((type1[0] == 'L') || (type1[0] == 'S')) &&
((type2[0] == 'L') || (type2[0] == 'S')))
return TRUE;
return !lstrcmpW(type1, type2);
}
static UINT merge_verify_colnames(MSIQUERY *dbview, MSIQUERY *mergeview) static UINT merge_verify_colnames(MSIQUERY *dbview, MSIQUERY *mergeview)
{ {
MSIRECORD *dbrec, *mergerec; MSIRECORD *dbrec, *mergerec;
...@@ -1126,7 +1139,7 @@ static UINT merge_verify_colnames(MSIQUERY *dbview, MSIQUERY *mergeview) ...@@ -1126,7 +1139,7 @@ static UINT merge_verify_colnames(MSIQUERY *dbview, MSIQUERY *mergeview)
if (!MSI_RecordGetString(mergerec, i)) if (!MSI_RecordGetString(mergerec, i))
break; break;
if (lstrcmpW(MSI_RecordGetString(dbrec, i), if (!merge_type_match(MSI_RecordGetString(dbrec, i),
MSI_RecordGetString(mergerec, i))) MSI_RecordGetString(mergerec, i)))
{ {
r = ERROR_DATATYPE_MISMATCH; r = ERROR_DATATYPE_MISMATCH;
......
...@@ -7273,7 +7273,7 @@ static void test_dbmerge(void) ...@@ -7273,7 +7273,7 @@ static void test_dbmerge(void)
/* column sting types don't match exactly */ /* column sting types don't match exactly */
r = MsiDatabaseMergeA(hdb, href, "MergeErrors"); r = MsiDatabaseMergeA(hdb, href, "MergeErrors");
todo_wine ok(r == ERROR_SUCCESS, ok(r == ERROR_SUCCESS,
"Expected ERROR_SUCCESS, got %d\n", r); "Expected ERROR_SUCCESS, got %d\n", r);
/* nothing in MergeErrors */ /* nothing in MergeErrors */
......
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