1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Add the support of 'SUBSTR' function compatible with Oracle and SAPDB (SCRUM #872)

sql/lex.h:
  Add SUBSTR aliased to SUBSTRING
sql/item_strfunc.cc:
  Implement SUBSTR negative offset
mysql-test/t/func_str.test:
  New tests for SUBSTR
mysql-test/r/func_str.result:
  Updated SUBSTR results
This commit is contained in:
unknown
2003-07-11 18:55:03 -07:00
parent 531a5d76bf
commit a5ce6a49dd
4 changed files with 35 additions and 1 deletions

View File

@ -294,3 +294,14 @@ select
;
show create table t1;
drop table t1;
#
# test for SUBSTR
#
select SUBSTR('abcdefg',3,2);
select SUBSTRING('abcdefg',3,2);
select SUBSTR('abcdefg',-3,2) FROM DUAL;
select SUBSTR('abcdefg',-1,5) FROM DUAL;
select SUBSTR('abcdefg',0,0) FROM DUAL;
select SUBSTR('abcdefg',-1,-1) FROM DUAL;
select SUBSTR('abcdefg',1,-1) FROM DUAL;