Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor & fix unsafe pg and fb identifiers #37

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

mkgrgis
Copy link
Contributor

@mkgrgis mkgrgis commented Jan 1, 2023

Full test:

CREATE TABLE "AB" ("AB" int, "Ab" INT, "aB" INT, "ab" INT, "c" boolean);
CREATE TABLE "aB" ("AB" int, "Ab" INT, "aB" INT, "ab" INT, "c" boolean);
CREATE TABLE "Ab" ("AB" int, "Ab" INT, "aB" INT, "ab" INT, "c" boolean);
CREATE TABLE "ab" ("AB" int, "Ab" INT, "aB" INT, "ab" INT, "c" boolean);
INSERT INTO "AB" ("AB","Ab","aB","ab","c") VALUES
	 (1,2,3,4,false);
INSERT INTO "AB" ("AB","Ab","aB","ab","c") VALUES
	 (5,6,7,8,true);
INSERT INTO "AB" ("AB","Ab","aB","ab","c") VALUES
	 (9,10,11,12,NULL);
INSERT INTO "aB" SELECT * FROM "AB";
INSERT INTO "Ab" SELECT * FROM "AB";
INSERT INTO "ab" SELECT * FROM "AB";

INSERT INTO AB ("AB","Ab","aB","ab","c") VALUES
	 (1,1,1,1,false);
INSERT INTO "Ab" ("AB","Ab","aB","ab","c") VALUES
	 (2,2,2,2,false);
INSERT INTO "aB" ("AB","Ab","aB","ab","c") VALUES
	 (3,3,3,3,false);
INSERT INTO "ab" ("AB","Ab","aB","ab","c") VALUES
	 (4,4,4,4,false);

DROP TABLE "ΓΔ";
DROP TABLE "γΔ";
DROP TABLE "Γδ";
DROP TABLE "γδ";

CREATE TABLE "ΓΔ" ("ΓΔ" int, "Γδ" INT, "γΔ" INT, "γδ" INT, "c" boolean); CREATE TABLE "γΔ" ("ΓΔ" int, "Γδ" INT, "γΔ" INT, "γδ" INT, "c" boolean); CREATE TABLE "Γδ" ("ΓΔ" int, "Γδ" INT, "γΔ" INT, "γδ" INT, "c" boolean); CREATE TABLE "γδ" ("ΓΔ" int, "Γδ" INT, "γΔ" INT, "γδ" INT, "c" boolean); INSERT INTO "ΓΔ" ("ΓΔ","Γδ","γΔ","γδ","c") VALUES
	 (1,2,3,4,false);
INSERT INTO "ΓΔ" ("ΓΔ","Γδ","γΔ","γδ","c") VALUES
	 (5,6,7,8,true);
INSERT INTO "ΓΔ" ("ΓΔ","Γδ","γΔ","γδ","c") VALUES
	 (9,10,11,12,NULL);
INSERT INTO "γΔ" SELECT * FROM "ΓΔ";
INSERT INTO "Γδ" SELECT * FROM "ΓΔ";
INSERT INTO "γδ" SELECT * FROM "ΓΔ";

INSERT INTO "ΓΔ" ("ΓΔ","Γδ","γΔ","γδ","c") VALUES
	 (1,1,1,1,false);
INSERT INTO "Γδ" ("ΓΔ","Γδ","γΔ","γδ","c") VALUES
	 (2,2,2,2,false);
INSERT INTO "γΔ" ("ΓΔ","Γδ","γΔ","γδ","c") VALUES
	 (3,3,3,3,false);
INSERT INTO "γδ" ("ΓΔ","Γδ","γΔ","γδ","c") VALUES
	 (4,4,4,4,false);

Full test:
CREATE TABLE "AB" ("AB" int, "Ab" INT, "aB" INT, "ab" INT, "c" boolean);
CREATE TABLE "aB" ("AB" int, "Ab" INT, "aB" INT, "ab" INT, "c" boolean);
CREATE TABLE "Ab" ("AB" int, "Ab" INT, "aB" INT, "ab" INT, "c" boolean);
CREATE TABLE "ab" ("AB" int, "Ab" INT, "aB" INT, "ab" INT, "c" boolean);
INSERT INTO AB (AB,"Ab","aB","ab","c") VALUES
	 (1,2,3,4,false);
INSERT INTO AB (AB,"Ab","aB","ab","c") VALUES
	 (5,6,7,8,true);
INSERT INTO AB (AB,"Ab","aB","ab","c") VALUES
	 (9,10,11,12,NULL);
INSERT INTO "aB" SELECT * FROM "AB";
INSERT INTO "Ab" SELECT * FROM "AB";
INSERT INTO "ab" SELECT * FROM "AB";

INSERT INTO AB (AB,"Ab","aB","ab","c") VALUES
	 (1,1,1,1,false);
INSERT INTO "Ab" (AB,"Ab","aB","ab","c") VALUES
	 (2,2,2,2,false);
INSERT INTO "aB" (AB,"Ab","aB","ab","c") VALUES
	 (3,3,3,3,false);
INSERT INTO "ab" (AB,"Ab","aB","ab","c") VALUES
	 (4,4,4,4,false);

DROP TABLE "ΓΔ";
DROP TABLE "γΔ";
DROP TABLE "Γδ";
DROP TABLE "γδ";

CREATE TABLE "ΓΔ" ("ΓΔ" int, "Γδ" INT, "γΔ" INT, "γδ" INT, "c" boolean);
CREATE TABLE "γΔ" ("ΓΔ" int, "Γδ" INT, "γΔ" INT, "γδ" INT, "c" boolean);
CREATE TABLE "Γδ" ("ΓΔ" int, "Γδ" INT, "γΔ" INT, "γδ" INT, "c" boolean);
CREATE TABLE "γδ" ("ΓΔ" int, "Γδ" INT, "γΔ" INT, "γδ" INT, "c" boolean);
INSERT INTO "ΓΔ" ("ΓΔ","Γδ","γΔ","γδ","c") VALUES
	 (1,2,3,4,false);
INSERT INTO "ΓΔ" ("ΓΔ","Γδ","γΔ","γδ","c") VALUES
	 (5,6,7,8,true);
INSERT INTO "ΓΔ" ("ΓΔ","Γδ","γΔ","γδ","c") VALUES
	 (9,10,11,12,NULL);
INSERT INTO "γΔ" SELECT * FROM "ΓΔ";
INSERT INTO "Γδ" SELECT * FROM "ΓΔ";
INSERT INTO "γδ" SELECT * FROM "ΓΔ";

INSERT INTO "ΓΔ" ("ΓΔ","Γδ","γΔ","γδ","c") VALUES
	 (1,1,1,1,false);
INSERT INTO "Γδ" ("ΓΔ","Γδ","γΔ","γδ","c") VALUES
	 (2,2,2,2,false);
INSERT INTO "γΔ" ("ΓΔ","Γδ","γΔ","γδ","c") VALUES
	 (3,3,3,3,false);
INSERT INTO "γδ" ("ΓΔ","Γδ","γΔ","γδ","c") VALUES
	 (4,4,4,4,false);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant