MSI: Fix selecting string columns and matching against a wildcard.
Mike McCormack
mike at codeweavers.com
Wed Dec 22 03:17:01 CST 2004
ChangeLog:
* Fix selecting string columns and matching against a wildcard.
-------------- next part --------------
Index: dlls/msi/query.h
===================================================================
RCS file: /home/wine/wine/dlls/msi/query.h,v
retrieving revision 1.11
diff -u -r1.11 query.h
--- dlls/msi/query.h 22 Aug 2004 21:38:47 -0000 1.11
+++ dlls/msi/query.h 22 Dec 2004 10:05:40 -0000
@@ -52,6 +52,7 @@
#define EXPR_STRCMP 7
#define EXPR_UTF8 8
#define EXPR_WILDCARD 9
+#define EXPR_COL_NUMBER_STRING 10
struct sql_str {
LPCWSTR data;
Index: dlls/msi/table.c
===================================================================
RCS file: /home/wine/wine/dlls/msi/table.c,v
retrieving revision 1.24
diff -u -r1.24 table.c
--- dlls/msi/table.c 10 Dec 2004 15:24:52 -0000 1.24
+++ dlls/msi/table.c 22 Dec 2004 10:05:40 -0000
@@ -1088,7 +1088,7 @@
return ERROR_FUNCTION_FAILED;
}
- TRACE("Data [%d][%d] = %d \n", row, col, *val );
+ /* TRACE("Data [%d][%d] = %d \n", row, col, *val ); */
return ERROR_SUCCESS;
}
Index: dlls/msi/where.c
===================================================================
RCS file: /home/wine/wine/dlls/msi/where.c,v
retrieving revision 1.13
diff -u -r1.13 where.c
--- dlls/msi/where.c 25 Aug 2004 17:31:39 -0000 1.13
+++ dlls/msi/where.c 22 Dec 2004 10:05:40 -0000
@@ -137,7 +137,7 @@
switch( expr->type )
{
- case EXPR_COL_NUMBER:
+ case EXPR_COL_NUMBER_STRING:
r = table->ops->fetch_int( table, row, expr->u.col_number, &val );
if( r != ERROR_SUCCESS )
return NULL;
@@ -190,6 +190,7 @@
switch( cond->type )
{
+ case EXPR_COL_NUMBER_STRING:
case EXPR_COL_NUMBER:
return table->ops->fetch_int( table, row, cond->u.col_number, val );
@@ -368,9 +369,19 @@
r = VIEW_find_column( table, cond->u.column, &val );
if( r == ERROR_SUCCESS )
{
- *valid = 1;
- cond->type = EXPR_COL_NUMBER;
- cond->u.col_number = val;
+ UINT type = 0;
+ r = table->ops->get_column_info( table, val, NULL, &type );
+ if( r == ERROR_SUCCESS )
+ {
+ if (type&MSITYPE_STRING)
+ cond->type = EXPR_COL_NUMBER_STRING;
+ else
+ cond->type = EXPR_COL_NUMBER;
+ cond->u.col_number = val;
+ *valid = 1;
+ }
+ else
+ *valid = 0;
}
else
{
@@ -390,7 +401,9 @@
/* check the type of the comparison */
if( ( cond->u.expr.left->type == EXPR_SVAL ) ||
- ( cond->u.expr.right->type == EXPR_SVAL ) )
+ ( cond->u.expr.left->type == EXPR_COL_NUMBER_STRING ) ||
+ ( cond->u.expr.right->type == EXPR_SVAL ) ||
+ ( cond->u.expr.right->type == EXPR_COL_NUMBER_STRING ) )
{
switch( cond->u.expr.op )
{
More information about the wine-patches
mailing list