https://git.reactos.org/?p=reactos.git;a=commitdiff;h=18123440c07d5787de37bd097701513fc5b9d43e

commit 18123440c07d5787de37bd097701513fc5b9d43e
Author:     winesync <[email protected]>
AuthorDate: Sat Mar 12 15:11:50 2022 +0100
Commit:     Mark Jansen <[email protected]>
CommitDate: Sun Mar 20 19:27:36 2022 +0100

    [WINESYNC] msi: Support NULL value in INSERT query.
    
    Signed-off-by: Piotr Caban <[email protected]>
    Signed-off-by: Hans Leidekker <[email protected]>
    Signed-off-by: Alexandre Julliard <[email protected]>
    
    wine commit id 63ccdfeaaab56aca42d21a884789eb5048064276 by Piotr Caban 
<[email protected]>
---
 dll/win32/msi/sql.y                      | 9 ++++++++-
 modules/rostests/winetests/msi/package.c | 2 +-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/dll/win32/msi/sql.y b/dll/win32/msi/sql.y
index 366764d5aeb..2101c680eb3 100644
--- a/dll/win32/msi/sql.y
+++ b/dll/win32/msi/sql.y
@@ -658,6 +658,12 @@ const_val:
             if( !$$ )
                 YYABORT;
         }
+   | TK_NULL
+        {
+            $$ = EXPR_sval( info, NULL );
+            if ( !$$ )
+                YYABORT;
+        }
     ;
 
 column_val:
@@ -921,7 +927,8 @@ static struct expr * EXPR_sval( void *info, const struct 
sql_str *str )
     if( e )
     {
         e->type = EXPR_SVAL;
-        if( SQL_getstring( info, str, (LPWSTR *)&e->u.sval ) != ERROR_SUCCESS )
+        if( !str) e->u.sval = NULL;
+        else if( SQL_getstring( info, str, (LPWSTR *)&e->u.sval ) != 
ERROR_SUCCESS )
             return NULL; /* e will be freed by query destructor */
     }
     return e;
diff --git a/modules/rostests/winetests/msi/package.c 
b/modules/rostests/winetests/msi/package.c
index e3a08944d51..c2e2106c38b 100644
--- a/modules/rostests/winetests/msi/package.c
+++ b/modules/rostests/winetests/msi/package.c
@@ -3705,7 +3705,7 @@ static void test_states(void)
     add_custom_action_entry( hdb, "'ConditionCheck7', 19, '', 'Condition check 
failed (7)'" );
     add_custom_action_entry( hdb, "'ConditionCheck8', 19, '', 'Condition check 
failed (8)'" );
     add_custom_action_entry( hdb,
-            "'VBFeatureRequest', 38, '', 
'Session.FeatureRequestState(\"three\") = 3'" );
+            "'VBFeatureRequest', 38, NULL, 
'Session.FeatureRequestState(\"three\") = 3'" );
 
     add_install_execute_sequence_entry( hdb, "'ConditionCheck1', 'REINSTALL', 
'798'" );
     add_install_execute_sequence_entry( hdb, "'ConditionCheck2', 'NOT REMOVE 
AND Preselected', '799'" );

Reply via email to