| |
802 |
802 |
} { |
| |
803 |
803 |
aa_equals "" [db_get_quote_indices {'a'}] {0 2} |
| |
804 |
804 |
aa_equals "" [db_get_quote_indices {'a''}] {} |
| |
805 |
805 |
aa_equals "" [db_get_quote_indices {'a'a'a'}] {0 2 4 6} |
| |
806 |
806 |
aa_equals "" [db_get_quote_indices {a'b'c'd''s'}] {1 3 5 10} |
| |
807 |
807 |
aa_equals "" [db_get_quote_indices {'}] {} |
| |
808 |
808 |
aa_equals "" [db_get_quote_indices {''}] {} |
| |
809 |
809 |
aa_equals "" [db_get_quote_indices {a''a}] {} |
| |
810 |
810 |
aa_equals "" [db_get_quote_indices {a'b'a}] {1 3} |
| |
811 |
811 |
aa_equals "" [db_get_quote_indices {'a''b'}] {0 5} |
| |
812 |
812 |
} |
| |
813 |
813 |
|
| |
814 |
814 |
aa_register_case \ |
| |
815 |
815 |
-procs db_bind_var_substitution \ |
| |
816 |
816 |
-cats {api} \ |
| |
817 |
817 |
db_bind_var_substitution { |
| |
818 |
818 |
Test the proc db_bind_var_substitution. |
| |
819 |
819 |
|
| |
820 |
820 |
@author Peter Marklund |
| |
821 |
821 |
} { |
| |
|
822 |
|
| |
|
823 |
# DRB: Not all of these test cases work for Oracle (select can't be used in |
| |
|
824 |
# db_exec_plsql) and bindvar substituion is done by Oracle, not the driver, |
| |
|
825 |
# anyway so there's not much point in testing. These tests really test |
| |
|
826 |
# Oracle bindvar emulation, in other words... |
| |
|
827 |
|
| |
|
828 |
if { [db_type] ne "oracle" } { |
| |
822 |
829 |
set sql {to_char(fm.posting_date, 'YYYY-MM-DD HH24:MI:SS')} |
| |
823 |
830 |
aa_equals "don't subst bind vars in quoted date" [db_bind_var_substitution $sql {SS 3 MI 4}] $sql |
| |
824 |
831 |
|
| |
825 |
832 |
set sql {to_char(fm.posting_date, :SS)} |
| |
826 |
833 |
aa_equals "don't subst bind vars in quoted date" [db_bind_var_substitution $sql {SS 3 MI 4}] {to_char(fm.posting_date, '3')} |
| |
827 |
834 |
|
| |
828 |
835 |
set sql {to_char(fm.posting_date, don''t subst ':SS', do subst :SS )} |
| |
829 |
836 |
aa_equals "don't subst bind vars in quoted date" [db_bind_var_substitution $sql {SS 3 MI 4}] {to_char(fm.posting_date, don''t subst ':SS', do subst '3' )} |
| |
830 |
837 |
|
| |
|
838 |
|
| |
831 |
839 |
set SS 3 |
| |
832 |
840 |
set db_value [db_exec_plsql test_bind { |
| |
833 |
841 |
select ':SS' |
| |
834 |
842 |
}] |
| |
835 |
843 |
aa_equals "db_exec_plsql should not bind quoted var" $db_value ":SS" |
| |
836 |
844 |
|
| |
837 |
845 |
set db_value [db_exec_plsql test_bind { |
| |
838 |
846 |
select :SS |
| |
839 |
847 |
}] |
| |
840 |
848 |
aa_equals "db_exec_plsql bind not quoted var" $db_value "3" |
| |
841 |
849 |
} |
| |
|
850 |
} |
| |
842 |
851 |
|
| |
843 |
852 |
aa_register_case -cats {api} \ |
| |
844 |
853 |
-bugs 1450 \ |
| |
845 |
854 |
acs_tcl__process_enhanced_correctly { |
| |
846 |
855 |
|
| |
847 |
856 |
Process sample text correctly |
| |
848 |
857 |
@author Nima Mazloumi |
| |
849 |
858 |
} { |
| |
850 |
859 |
|
| |
851 |
860 |
set string_with_img {<img src="http://test.test/foo.png">} |
| |
852 |
861 |
aa_log "Original string is $string_with_img" |
| |
853 |
862 |
set html_version [ad_enhanced_text_to_html $string_with_img] |
| |
854 |
863 |
aa_true "new: $html_version should be the same" [string equal $html_version $string_with_img] |
| |
855 |
864 |
} |
| |
856 |
865 |
|
| |
857 |
866 |
aa_register_case -cats {api db} db__caching { |
| |
858 |
867 |
test db_* API caching |
| |
859 |
868 |
} { |
| |
860 |
869 |
|
| |
861 |
870 |
# Check db_string caching |