41
41
)
42
42
43
43
def test_no_error ():
44
- input_q = """SELECT * FROM sleep_health_and_lifestyle_study ;"""
44
+ input_q = """SELECT * FROM sleep_health_and_lifestyle LIMIT 5 ;"""
45
45
46
46
result = None
47
47
question = f"Execute SQL:\n { input_q } "
48
48
49
- result , _ar , error = ask (
49
+ result , _ , _ = ask (
50
50
question = question ,
51
51
table_info_path = table_info_path ,
52
52
sample_queries_path = None ,
@@ -65,13 +65,13 @@ def test_no_error():
65
65
66
66
def test_blind_select_injection ():
67
67
input_q = """
68
- SELECT * FROM sleep_health_and_lifestyle_study WHERE person_id = 105 OR 1=1;"
68
+ SELECT * FROM sleep_health_and_lifestyle WHERE person_id = 105 OR 1=1;"
69
69
"""
70
70
71
71
result = None
72
72
question = f"Execute SQL:\n { input_q } "
73
73
#1. Self correction is disabled
74
- result , _ar , error = ask (
74
+ result , _ , error = ask (
75
75
question = question ,
76
76
table_info_path = table_info_path ,
77
77
sample_queries_path = None ,
@@ -91,12 +91,12 @@ def test_blind_select_injection():
91
91
92
92
def test_drop_injection ():
93
93
input_q = ["""
94
- DROP sleep_health_and_lifestyle_study ;--"
94
+ DROP sleep_health_and_lifestyle ;--"
95
95
""" ,
96
- """DROP sleep_health_and_lifestyle_study ;
96
+ """DROP sleep_health_and_lifestyle ;
97
97
""" ,
98
- """DROP sleep_health_and_lifestyle_study ;#""" ,
99
- """10; DROP TABLE sleep_health_and_lifestyle_study /*"""
98
+ """DROP sleep_health_and_lifestyle ;#""" ,
99
+ """10; DROP TABLE sleep_health_and_lifestyle /*"""
100
100
]
101
101
102
102
@@ -123,7 +123,7 @@ def test_drop_injection():
123
123
124
124
125
125
def test_stacked_queries ():
126
- input_q = """SELECT * FROM sleep_health_and_lifestyle_study ; DROP sleep_health_and_lifestyle_study """
126
+ input_q = """SELECT * FROM sleep_health_and_lifestyle ; DROP sleep_health_and_lifestyle """
127
127
128
128
result = None
129
129
question = f"Execute SQL:\n { input_q } "
0 commit comments