I found a BUG when executing a SELECT with the LIKE clause every time the STRING is greater than the field size.
Below I will try to exemplify the incident so that it is possible to correct the BUG correctly:
create table actors (
intid,
name varchar(10)
);
insert into actors
(id, name)
values
(1, 'James Wick');
1 examples of error-free execution
select * from actors
where name like 'James%';
STRING 'James%' with 6 characters runs without problems as the maximum field size is 10 characters
2 examples of error-free execution
select * from actors
where name like 'James%';
STRING '%Wick%' with 6 characters runs without problems as the maximum field size is 10 characters
3 examples of execution with error
select * from actors
where name like 'James Wick%';
STRING 'James Wick%' with 11 characters exceeds the 10 character size of the name field and causes a gdscode error: 335544569
4 examples of execution with error
select * from actors
where name like '%James Wick%';
STRING '%James Wick%' with 12 characters exceeds the 10 character length of the name field and causes a gdscode error: 335544569
Solution
In my understanding, queries with the LIKE clause should not carry out any type of treatment related to the size of the searched field, returning records when the query condition is met.
I found a BUG when executing a SELECT with the LIKE clause every time the STRING is greater than the field size.
Below I will try to exemplify the incident so that it is possible to correct the BUG correctly:
1 examples of error-free execution
2 examples of error-free execution
3 examples of execution with error
4 examples of execution with error
Solution