Re: [PATCH] implement MSIMODIFY_MERGE function in TABLE_modify
On Mon, 2012-03-26 at 11:14 +0200, Andoni Morales wrote:
- case MSIMODIFY_REPLACE: case MSIMODIFY_MERGE: + /* check for a duplicated key */ + r = msi_table_find_row( tv, rec, &row, column ); + if (r == ERROR_SUCCESS) { + /* check that both are identical */ + r = compare_record (tv, row, rec); + if (r != ERROR_SUCCESS) + break; + } else { + r = table_validate_new( tv, rec, NULL ); + if (r != ERROR_SUCCESS) + break; + r = TABLE_insert_row( view, rec, -1, FALSE ); + break; + } + + case MSIMODIFY_REPLACE:
Please use bracketing and indentation style of the surrounding code. Some tests would be nice.
El 26 de marzo de 2012 11:28, Hans Leidekker <hans(a)codeweavers.com>escribió:
On Mon, 2012-03-26 at 11:14 +0200, Andoni Morales wrote:
- case MSIMODIFY_REPLACE: case MSIMODIFY_MERGE: + /* check for a duplicated key */ + r = msi_table_find_row( tv, rec, &row, column ); + if (r == ERROR_SUCCESS) { + /* check that both are identical */ + r = compare_record (tv, row, rec); + if (r != ERROR_SUCCESS) + break; + } else { + r = table_validate_new( tv, rec, NULL ); + if (r != ERROR_SUCCESS) + break; + r = TABLE_insert_row( view, rec, -1, FALSE ); + break; + } + + case MSIMODIFY_REPLACE:
Please use bracketing and indentation style of the surrounding code. Some tests would be nice.
Sorry, I attached the wrong patch file. I have fixed the indentation and will add tests too. -- Andoni Morales Alastruey LongoMatch:The Digital Coach http://www.longomatch.ylatuya.es
El 26 de marzo de 2012 11:48, Andoni Morales <ylatuya(a)gmail.com> escribió:
El 26 de marzo de 2012 11:28, Hans Leidekker <hans(a)codeweavers.com>escribió:
On Mon, 2012-03-26 at 11:14 +0200, Andoni Morales wrote:
- case MSIMODIFY_REPLACE: case MSIMODIFY_MERGE: + /* check for a duplicated key */ + r = msi_table_find_row( tv, rec, &row, column ); + if (r == ERROR_SUCCESS) { + /* check that both are identical */ + r = compare_record (tv, row, rec); + if (r != ERROR_SUCCESS) + break; + } else { + r = table_validate_new( tv, rec, NULL ); + if (r != ERROR_SUCCESS) + break; + r = TABLE_insert_row( view, rec, -1, FALSE ); + break; + } + + case MSIMODIFY_REPLACE:
Please use bracketing and indentation style of the surrounding code. Some tests would be nice.
Updated patch with tests, which revealed bugs in the previous pathc :) Cheers, Andoni
Sorry, I attached the wrong patch file. I have fixed the indentation and will add tests too.
-- Andoni Morales Alastruey
LongoMatch:The Digital Coach http://www.longomatch.ylatuya.es
-- Andoni Morales Alastruey LongoMatch:The Digital Coach http://www.longomatch.ylatuya.es
participants (2)
-
Andoni Morales -
Hans Leidekker