Skip to content

Commit 3e237d8

Browse files
authored
escape sql variables (#1037)
1 parent 5c958ec commit 3e237d8

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/oo/cl_oo_factory.clas.abap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ CLASS cl_oo_factory IMPLEMENTATION.
3131

3232
METHOD if_oo_clif_source~get_source.
3333
DATA ls_data TYPE reposrc.
34-
SELECT SINGLE * FROM reposrc INTO ls_data WHERE progname = mv_name.
34+
SELECT SINGLE * FROM reposrc INTO @ls_data WHERE progname = @mv_name.
3535
SPLIT ls_data-data AT |\n| INTO TABLE source.
3636
ENDMETHOD.
3737
ENDCLASS.

src/unit/osql/cl_osql_test_environment.clas.abap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ CLASS cl_osql_test_environment IMPLEMENTATION.
4545
TRY.
4646
CREATE DATA ref TYPE (lv_table).
4747
ASSIGN ref->* TO <fs>.
48-
SELECT SINGLE * FROM (lv_table) INTO <fs>.
48+
SELECT SINGLE * FROM (lv_table) INTO @<fs>.
4949
CATCH cx_sy_create_data_error cx_sy_dynamic_osql_semantics.
5050
WRITE '@KERNEL throw new Error(`table ${lv_table.get().trimEnd()} invalid or does not exist`);'.
5151
ENDTRY.
@@ -124,7 +124,7 @@ CLASS cl_osql_test_environment IMPLEMENTATION.
124124
READ TABLE mt_tables WITH KEY table_line = lv_table TRANSPORTING NO FIELDS.
125125
ASSERT sy-subrc = 0.
126126

127-
INSERT (lv_table) FROM TABLE i_data.
127+
INSERT (lv_table) FROM TABLE @i_data.
128128
ASSERT sy-subrc = 0.
129129

130130
ENDMETHOD.

src/unit/osql/cl_osql_test_environment.clas.testclasses.abap

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,23 @@ CLASS ltcl_test IMPLEMENTATION.
1616
DATA lt_after TYPE ty_tdevc.
1717
DATA ls_row TYPE tdevc.
1818

19-
SELECT * FROM tdevc INTO TABLE lt_before ORDER BY PRIMARY KEY.
19+
SELECT * FROM tdevc INTO TABLE @lt_before ORDER BY PRIMARY KEY.
2020

2121
APPEND 'TDEVC' TO lt_tables.
2222
li_environment = cl_osql_test_environment=>create( lt_tables ).
2323
ls_row-devclass = 'HELLO'.
2424
INSERT ls_row INTO TABLE lt_insert.
2525
li_environment->insert_test_data( lt_insert ).
2626

27-
SELECT * FROM tdevc INTO TABLE lt_double ORDER BY PRIMARY KEY.
27+
SELECT * FROM tdevc INTO TABLE @lt_double ORDER BY PRIMARY KEY.
2828
cl_abap_unit_assert=>assert_equals(
2929
act = lt_double
3030
exp = lt_insert ).
3131

3232
li_environment->destroy( ).
3333

3434
* check table is back to normal
35-
SELECT * FROM tdevc INTO TABLE lt_after ORDER BY PRIMARY KEY.
35+
SELECT * FROM tdevc INTO TABLE @lt_after ORDER BY PRIMARY KEY.
3636
cl_abap_unit_assert=>assert_equals(
3737
act = lt_after
3838
exp = lt_before ).

0 commit comments

Comments
 (0)