Piotr Caban : msi: Support NULL value in INSERT query.

Alexandre Julliard julliard at winehq.org
Thu Apr 19 16:54:19 CDT 2018


Module: wine
Branch: master
Commit: 63ccdfeaaab56aca42d21a884789eb5048064276
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=63ccdfeaaab56aca42d21a884789eb5048064276

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Wed Apr 18 17:59:25 2018 +0200

msi: Support NULL value in INSERT query.

Signed-off-by: Piotr Caban <piotr at codeweavers.com>
Signed-off-by: Hans Leidekker <hans at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/msi/sql.y           | 9 ++++++++-
 dlls/msi/tests/package.c | 2 +-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/dlls/msi/sql.y b/dlls/msi/sql.y
index 366764d..2101c68 100644
--- a/dlls/msi/sql.y
+++ b/dlls/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/dlls/msi/tests/package.c b/dlls/msi/tests/package.c
index e3a0894..c2e2106 100644
--- a/dlls/msi/tests/package.c
+++ b/dlls/msi/tests/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'" );




More information about the wine-cvs mailing list