Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
241933e1
Commit
241933e1
authored
Feb 25, 2009
by
James Hawkins
Committed by
Alexandre Julliard
Feb 26, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: A non-temporary table cannot have a temporary primary key.
parent
74aa0534
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
4 deletions
+17
-4
create.c
dlls/msi/create.c
+9
-0
sql.y
dlls/msi/sql.y
+8
-2
db.c
dlls/msi/tests/db.c
+0
-2
No files found.
dlls/msi/create.c
View file @
241933e1
...
...
@@ -161,6 +161,7 @@ UINT CREATE_CreateView( MSIDATABASE *db, MSIVIEW **view, LPWSTR table,
UINT
r
;
column_info
*
col
;
BOOL
temp
=
TRUE
;
BOOL
tempprim
=
FALSE
;
TRACE
(
"%p
\n
"
,
cv
);
...
...
@@ -179,6 +180,14 @@ UINT CREATE_CreateView( MSIDATABASE *db, MSIVIEW **view, LPWSTR table,
if
(
!
col
->
temporary
)
temp
=
FALSE
;
else
if
(
col
->
type
&
MSITYPE_KEY
)
tempprim
=
TRUE
;
}
if
(
!
temp
&&
tempprim
)
{
msi_free
(
cv
);
return
ERROR_FUNCTION_FAILED
;
}
/* fill the structure */
...
...
dlls/msi/sql.y
View file @
241933e1
...
...
@@ -45,6 +45,7 @@ typedef struct tag_SQL_input
MSIDATABASE *db;
LPCWSTR command;
DWORD n, len;
UINT r;
MSIVIEW **view; /* view structure for the resulting query */
struct list *mem;
} SQL_input;
...
...
@@ -166,12 +167,16 @@ onecreate:
{
SQL_input* sql = (SQL_input*) info;
MSIVIEW *create = NULL;
UINT r;
if( !$5 )
YYABORT;
CREATE_CreateView( sql->db, &create, $3, $5, FALSE );
r =
CREATE_CreateView( sql->db, &create, $3, $5, FALSE );
if( !create )
{
sql->r = r;
YYABORT;
}
$$ = create;
}
| TK_CREATE TK_TABLE table TK_LP table_def TK_RP TK_HOLD
...
...
@@ -914,6 +919,7 @@ UINT MSI_ParseSQL( MSIDATABASE *db, LPCWSTR command, MSIVIEW **phview,
sql.command = command;
sql.n = 0;
sql.len = 0;
sql.r = ERROR_BAD_QUERY_SYNTAX;
sql.view = phview;
sql.mem = mem;
...
...
@@ -923,7 +929,7 @@ UINT MSI_ParseSQL( MSIDATABASE *db, LPCWSTR command, MSIVIEW **phview,
if( r )
{
*sql.view = NULL;
return
ERROR_BAD_QUERY_SYNTAX
;
return
sql.r
;
}
return ERROR_SUCCESS;
...
...
dlls/msi/tests/db.c
View file @
241933e1
...
...
@@ -3286,14 +3286,12 @@ static void test_temporary_table(void)
cond
=
MsiDatabaseIsTablePersistent
(
hdb
,
"T3"
);
ok
(
cond
==
MSICONDITION_TRUE
,
"wrong return condition
\n
"
);
todo_wine
{
query
=
"CREATE TABLE `T4` ( `B` SHORT NOT NULL, `C` CHAR(255) TEMPORARY PRIMARY KEY `C`)"
;
r
=
run_query
(
hdb
,
0
,
query
);
ok
(
r
==
ERROR_FUNCTION_FAILED
,
"failed to add table
\n
"
);
cond
=
MsiDatabaseIsTablePersistent
(
hdb
,
"T4"
);
ok
(
cond
==
MSICONDITION_NONE
,
"wrong return condition
\n
"
);
}
query
=
"CREATE TABLE `T5` ( `B` SHORT NOT NULL TEMP, `C` CHAR(255) TEMP PRIMARY KEY `C`) HOLD"
;
r
=
run_query
(
hdb
,
0
,
query
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment