Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Zwinkau
libfirm
Commits
32418b22
Commit
32418b22
authored
Jul 27, 2011
by
Matthias Braun
Browse files
fix statev messing up column-name/value relation in sqlite3
parent
89bb4f7c
Changes
1
Hide whitespace changes
Inline
Side-by-side
scripts/statev_sql.py
View file @
32418b22
...
...
@@ -81,7 +81,7 @@ class EmitMysql(EmitBase):
keys
=
"id, "
+
", "
.
join
(
evcols
)
marks
=
","
.
join
([
'%s'
]
*
(
len
(
evcols
)
+
1
))
self
.
evinsert
=
"insert into `%s` values (%s)"
%
(
self
.
evtab
,
marks
)
self
.
evinsert
=
"insert into `%s`
(%s)
values (%s)"
%
(
self
.
evtab
,
keys
,
marks
)
keys
=
", "
.
join
(
ctxcols
)
marks
=
","
.
join
([
'%s'
]
*
len
(
ctxcols
))
...
...
@@ -163,6 +163,8 @@ class Conv:
evind
=
0
ctxcols
=
dict
()
evcols
=
dict
()
ctxlist
=
[]
evlist
=
[]
linenr
=
0
self
.
valid_keys
=
set
()
...
...
@@ -180,6 +182,7 @@ class Conv:
key
=
fields
[
i
]
if
not
ctxcols
.
has_key
(
key
):
ctxcols
[
key
]
=
ctxind
ctxlist
.
append
(
key
)
ctxind
+=
1
elif
fields
[
0
]
==
'E'
:
...
...
@@ -195,11 +198,12 @@ class Conv:
if
not
evcols
.
has_key
(
key
):
self
.
valid_keys
.
add
(
key
)
evcols
[
key
]
=
evind
evlist
.
append
(
key
)
evind
+=
1
self
.
ctxcols
=
ctxcols
self
.
evcols
=
evcols
return
(
ctx
cols
,
evcols
)
return
(
ctx
list
,
evlist
)
def
input
(
self
):
return
fileinput
.
FileInput
(
files
=
self
.
files
,
openhook
=
fileinput
.
hook_compressed
)
...
...
@@ -291,7 +295,7 @@ class Conv:
print
'%10d / %10d'
%
(
curr_event
,
self
.
n_events
)
for
p
in
range
(
1
,
len
(
items
),
2
):
key
=
items
[
p
]
key
=
items
[
p
]
if
key
not
in
self
.
evcols
:
continue
...
...
@@ -299,7 +303,7 @@ class Conv:
if
self
.
evvals
[
keyidx
]
!=
None
:
self
.
flush_events
(
self
.
curr_id
)
value
=
items
[
p
+
1
]
value
=
items
[
p
+
1
]
self
.
evvals
[
keyidx
]
=
value
def
__init__
(
self
):
...
...
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