81#define INITIAL_REORDER_SIZE 16
83#define INVALID_ROW_INDEX (-1)
117 if (
row >=
wv->row_count)
129 if (
wv->reorder_size <=
wv->row_count)
132 UINT newsize =
wv->reorder_size * 2;
134 new_reorder =
realloc(
wv->reorder, newsize *
sizeof(*new_reorder));
137 memset(new_reorder +
wv->reorder_size, 0, (newsize -
wv->reorder_size) *
sizeof(*new_reorder));
139 wv->reorder = new_reorder;
140 wv->reorder_size = newsize;
148 wv->reorder[
wv->row_count++] =
new;
163 while (col >
table->col_count)
165 col -=
table->col_count;
184 if (
column->unparsed.table)
194 for(
i = 1;
i <=
table->col_count;
i++)
198 r =
table->view->ops->get_column_info(
table->view,
i, &col_name, column_type,
246 TRACE(
"%p %d %d %p\n", wv,
row, col, stm );
259 return table->view->ops->fetch_stream(
table->view, rows[
table->table_index], col, stm );
269 TRACE(
"view %p, row %u, col %u, val %d.\n", wv,
row, col,
val );
309 TRACE(
"view %p, row %u, col %u, stream %p.\n", wv,
row, col,
stream);
344 for (
i = 0;
i <
table->col_count;
i++) {
347 if (!(mask_copy & (1 <<
i)))
356 mask_copy >>=
table->col_count;
389 r =
table->view->ops->set_row(
table->view, rows[
table->table_index], reduced, reduced_mask);
415 return wv->
tables->view->ops->delete_row(wv->
tables->view, rows[0]);
487 ERR(
"Unknown operator %d\n",
expr->op );
503 return table->view->ops->fetch_int(
table->view, rows[
table->table_index],
527 ERR(
"Unknown operator %d\n",
expr->op );
559 ERR(
"Invalid expression type\n");
571 const WCHAR *l_str, *r_str;
582 if( l_str == r_str ||
583 ((!l_str || !*l_str) && (!r_str || !*r_str)) )
585 else if( l_str && ! r_str )
587 else if( r_str && ! l_str )
590 sr =
wcscmp( l_str, r_str );
615 *
val = tval - 0x8000;
622 *
val = tval - 0x80000000;
643 ERR(
"Invalid expression type\n");
656 for (table_rows[(*tables)->table_index] = 0;
657 table_rows[(*tables)->table_index] < (*tables)->row_count;
658 table_rows[(*tables)->table_index]++)
697 for (
i = 0;
i <
order->col_count;
i++)
701 r =
column->parsed.table->view->ops->fetch_int(
column->parsed.table->view,
703 column->parsed.column, &l_val);
710 r =
column->parsed.table->view->ops->fetch_int(
column->parsed.table->view,
712 column->parsed.column, &r_val);
720 return l_val < r_val ? -1 : 1;
748#define JOIN_TO_CONST_EXPR 0x10000
838 ERR(
"failed to get table dimensions\n");
843 if (
table->row_count == 0)
865 free(ordered_tables);
890 TRACE(
"%p %p %p\n", wv, rows, cols );
914 TRACE(
"%p %d %p %p %p %p\n", wv,
n,
name,
type, temporary, table_name );
924 type, temporary, table_name);
971 mask |= 1 << (
i - 1);
985 TRACE(
"%p %d %p\n", wv, eModifyMode, rec);
999 return table->view->ops->modify(
table->view, eModifyMode, rec,
row);
1002 switch (eModifyMode)
1026 WARN(
"%p %d %p %u - unknown mode\n",
view, eModifyMode, rec,
row );
1142 switch( cond->
type )
1156 else if ((
type&0xff) == 4)
1180 switch( cond->
u.
expr.op )
1218 ERR(
"Invalid expression type\n");
1235 wv =
calloc(1,
sizeof *wv);
1272 ERR(
"can't get table dimensions\n");
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
#define ERROR_CALL_NOT_IMPLEMENTED
#define ERROR_INVALID_PARAMETER
#define ERROR_NO_MORE_ITEMS
void msiobj_addref(MSIOBJECTHDR *info)
int msiobj_release(MSIOBJECTHDR *info)
static UINT WHERE_close(struct tagMSIVIEW *view)
static UINT add_row(MSIWHEREVIEW *wv, UINT vals[])
#define INITIAL_REORDER_SIZE
static UINT WHERE_set_string(struct tagMSIVIEW *view, UINT row, UINT col, const WCHAR *val, int len)
#define JOIN_TO_CONST_EXPR
static UINT expr_fetch_value(const union ext_column *expr, const UINT rows[], UINT *val)
static UINT WHERE_execute(struct tagMSIVIEW *view, MSIRECORD *record)
static UINT WHERE_set_row(struct tagMSIVIEW *view, UINT row, MSIRECORD *rec, UINT mask)
static void free_reorder(MSIWHEREVIEW *wv)
static INT INT_evaluate_binary(MSIWHEREVIEW *wv, const UINT rows[], const struct complex_expr *expr, INT *val, MSIRECORD *record)
static UINT WHERE_delete_row(struct tagMSIVIEW *view, UINT row)
static struct join_table ** ordertables(MSIWHEREVIEW *wv)
struct tagMSIORDERINFO MSIORDERINFO
static UINT check_condition(MSIWHEREVIEW *wv, MSIRECORD *record, struct join_table **tables, UINT table_rows[])
static UINT WHERE_get_dimensions(struct tagMSIVIEW *view, UINT *rows, UINT *cols)
static UINT STRING_evaluate(MSIWHEREVIEW *wv, const UINT rows[], const struct expr *expr, const MSIRECORD *record, const WCHAR **str)
static UINT INT_evaluate_unary(MSIWHEREVIEW *wv, const UINT rows[], const struct complex_expr *expr, INT *val, MSIRECORD *record)
struct tagMSIWHEREVIEW MSIWHEREVIEW
static void add_to_array(struct join_table **array, struct join_table *elem)
static UINT join_modify_update(struct tagMSIVIEW *view, MSIRECORD *rec)
static struct join_table * find_table(MSIWHEREVIEW *wv, UINT col, UINT *table_col)
static UINT WHERE_set_int(struct tagMSIVIEW *view, UINT row, UINT col, int val)
static UINT WHERE_get_column_info(struct tagMSIVIEW *view, UINT n, LPCWSTR *name, UINT *type, BOOL *temporary, LPCWSTR *table_name)
static int __cdecl compare_entry(const void *left, const void *right)
static UINT reorder_check(const struct expr *expr, struct join_table **ordered_tables, BOOL process_joins, struct join_table **lastused)
static UINT STRCMP_Evaluate(MSIWHEREVIEW *wv, const UINT rows[], const struct complex_expr *expr, INT *val, const MSIRECORD *record)
#define INVALID_ROW_INDEX
static UINT WHERE_VerifyCondition(MSIWHEREVIEW *wv, struct expr *cond, UINT *valid)
static UINT WHERE_fetch_int(struct tagMSIVIEW *view, UINT row, UINT col, UINT *val)
static UINT WHERE_evaluate(MSIWHEREVIEW *wv, const UINT rows[], struct expr *cond, INT *val, MSIRECORD *record)
static UINT find_row(MSIWHEREVIEW *wv, UINT row, UINT *(values[]))
static UINT parse_column(MSIWHEREVIEW *wv, union ext_column *column, UINT *column_type)
static BOOL in_array(struct join_table **array, struct join_table *elem)
static UINT WHERE_sort(struct tagMSIVIEW *view, column_info *columns)
static UINT init_reorder(MSIWHEREVIEW *wv)
static UINT WHERE_delete(struct tagMSIVIEW *view)
static const MSIVIEWOPS where_ops
UINT WHERE_CreateView(MSIDATABASE *db, MSIVIEW **view, LPWSTR tables, struct expr *cond)
static UINT WHERE_modify(struct tagMSIVIEW *view, MSIMODIFY eModifyMode, MSIRECORD *rec, UINT row)
static UINT join_find_row(MSIWHEREVIEW *wv, MSIRECORD *rec, UINT *row)
static UINT WHERE_fetch_stream(struct tagMSIVIEW *view, UINT row, UINT col, IStream **stm)
static UINT WHERE_set_stream(MSIVIEW *view, UINT row, UINT col, IStream *stream)
struct png_info_def *typedef unsigned char **typedef struct png_info_def *typedef struct png_info_def *typedef struct png_info_def *typedef unsigned char ** row
struct nls_table * tables
GLuint GLuint GLsizei GLenum type
GLuint GLuint GLsizei count
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLdouble GLdouble GLdouble r
GLboolean GLenum GLenum GLvoid * values
GLuint GLdouble GLdouble GLint GLint order
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
#define memcpy(s1, s2, n)
struct task_struct * current
int MSI_RecordGetInteger(MSIRECORD *, UINT)
UINT msi_string2id(const string_table *st, const WCHAR *data, int len, UINT *id)
const WCHAR * MSI_RecordGetString(const MSIRECORD *, UINT)
UINT msi_view_get_row(MSIDATABASE *, MSIVIEW *, UINT, MSIRECORD **)
BOOL MSI_RecordsAreFieldsEqual(MSIRECORD *a, MSIRECORD *b, UINT field)
const WCHAR * msi_string_lookup(const string_table *st, UINT id, int *len)
UINT MSI_RecordCopyField(MSIRECORD *, UINT, MSIRECORD *, UINT)
MSIRECORD * MSI_CreateRecord(UINT)
UINT MSI_RecordGetFieldCount(const MSIRECORD *rec)
@ MSIMODIFY_INSERT_TEMPORARY
@ MSIMODIFY_VALIDATE_DELETE
@ MSIMODIFY_VALIDATE_FIELD
#define EXPR_COL_NUMBER32
#define EXPR_COL_NUMBER_STRING
UINT TABLE_CreateView(MSIDATABASE *db, LPCWSTR name, MSIVIEW **view)
static unsigned __int64 next
#define offsetof(TYPE, MEMBER)
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
void __cdecl qsort(_Inout_updates_bytes_(_NumOfElements *_SizeOfElements) void *_Base, _In_ size_t _NumOfElements, _In_ size_t _SizeOfElements, _In_ int(__cdecl *_PtFuncCompare)(const void *, const void *))
struct tagMSIWHEREVIEW * wv
union ext_column columns[1]
struct join_table * tables
struct row_entry ** reorder
MSIORDERINFO * order_info
#define new(TYPE, numElems)
struct ext_column::@506 parsed
struct ext_column::@505 unparsed
#define ERROR_BAD_QUERY_SYNTAX
#define ERROR_FUNCTION_FAILED