Commit a070a825 authored by haoyuz3's avatar haoyuz3
Browse files

debug

parent e4a7a0af
......@@ -11,7 +11,7 @@ begin
EXECUTE format('alter table %s add column if not exists provtuple varchar(20)', tablename);
for _ctid in execute 'select ctid from ' || tablename for update
loop
tupleid = 'tuple ' || curid;
tupleid = 't' || curid;
EXECUTE format('update %s
set provtuple = ''%s''
where ctid = $1', tablename, tupleid)
......
create table student (
provtuple varchar(10),
name varchar(20),
age integer,
major varchar(20)
);
create table regu (
provtuple varchar(10),
name varchar(20),
courseid integer
);
insert into student values ('t1', 'jhon', 20, 'cs'), ('t2', 'mike', 21, 'cs'), ('t3', 'jack', 22, 'ece');
insert into regu values ('t1', 'jhon', 17), ('t2', 'jhon', 19), ('t3', 'mike', 21), ('t4', 'jack', 15), ('t5', 'jack', 19);
insert into student values ('jhon', 20, 'cs'), ('mike', 21, 'cs'), ('jack', 22, 'ece');
insert into regu values ('jhon', 17), ('jhon', 19), ('mike', 21), ('jack', 15), ('jack', 19);
select student.name from student join regu on student.name = regu.name;
provenance formula | name | provsql-token
(student.tuple student.0 ⊗ regu.tuple regu.0) ⊕ (student.tuple student.0 ⊗ regu.tuple regu.1) | jhon | 163f0cf8-179f-56b0-9232-5ebe6061f225
(student.tuple student.1 ⊗ regu.tuple regu.2) | mike | f201060b-b56c-5574-91ad-3f32287cd939
(student.tuple student.2 ⊗ regu.tuple regu.3) ⊕ (student.tuple student.2 ⊗ regu.tuple regu.4) | jack | 9ab59b74-1c5c-5123-8f9a-99fe90a422de
---------------------------
select student.name from student join (select name from regu) as r on student.name = r.name;
provenance formula | name | provsql-token
(student.tuple student.0 ⊗ regu.tuple regu.0) ⊕ (student.tuple student.0 ⊗ regu.tuple regu.1) | jhon | 76dca229-2a47-57b6-aa02-cff25d1c9847
(student.tuple student.1 ⊗ regu.tuple regu.2) | mike | 5e028b44-2e79-5b78-bbaa-90699d5497b2
(student.tuple student.2 ⊗ regu.tuple regu.3) ⊕ (student.tuple student.2 ⊗ regu.tuple regu.4) | jack | 09579be5-98ac-52ab-963b-be0c09ad5142
---------------------------
#!/bin/sh
dropdb test
createdb test
psql test < setup.sql
psql test < test.sql
psql test < ../config/setup.sql
psql test <../config/test.sql
psql test < ../config/func.sql
git pull
python3 provenance.py -q query.in -o output.txt config.txt
python3 ../src/provenance.py -q ../config/query.in -o output.txt ../config/config.txt
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment