Issue Details (XML | Word | Printable)

Key: MDL-16669
Type: Sub-task Sub-task
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Petr Skoda
Reporter: Eloy Lafuente (stronk7)
Votes: 0
Watchers: 0
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle
MDL-14679

Make sql_substr() to accept parameters instead of simply returning function name

Created: 25/Sep/08 05:27 AM   Updated: 29/Oct/08 04:09 AM
Component/s: Database SQL/XMLDB
Affects Version/s: 2.0
Fix Version/s: 2.0

Participants: Eloy Lafuente (stronk7) and Petr Skoda
Security Level: None
QA Assignee: Petr Skoda
Resolved date: 29/Oct/08
Affected Branches: MOODLE_20_STABLE
Fixed Branches: MOODLE_20_STABLE


 Description  « Hide
Until Moodle 2.0, the sql_substr() helper function (dmllib), is used without parameters at simply returns the "substring" function used for each DB.

Change this behaviour so it will look like:

$DB->sql_substr(string, from, len)

with len being optional.

- Implement it in new moodle_databases.
- Document it.
- Look for wrong usages in core.
- Add some tests, with and without len.

Ciao :-)

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Petr Skoda added a comment - 29/Oct/08 12:11 AM
done including unittests

Petr Skoda added a comment - 29/Oct/08 04:01 AM
grrr, sorry for the typo - I was testing the LENGTH() trick in pg

Eloy Lafuente (stronk7) added a comment - 29/Oct/08 04:09 AM - edited
bah, sorry my my usual typos too.

*by my: grrr... :-D