Skip to content
This repository has been archived by the owner on Oct 15, 2022. It is now read-only.

MySQL: linebreaks __NEWLINE__ and prefix 'mysql>' shown in example view #142

Closed
ghost opened this issue Aug 4, 2015 · 4 comments
Closed

Comments

@ghost
Copy link

ghost commented Aug 4, 2015

When DDG-ing for mysql substring, the example view contains:

SUBSTRING(str,pos), SUBSTRING(str FROM pos), SUBSTRING(str,pos,len), SUBSTRING(str FROM pos FOR len):
mysql> SELECT SUBSTRING('Quadratically',5); -> 'ratically' __NEWLINE__mysql> SELECT SUBSTRING('foobarbar' FROM 4); -> 'barbar' __NEWLINE__mysql> SELECT SUBSTRING('Quadratically',5,6); -> 'ratica' __NEWLINE__mysql> SELECT SUBSTRING('Sakila', -3); -> 'ila' __NEWLINE__mysql> SELECT SUBSTRING('Sakila', -5, 3); -> 'aki' __NEWLINE__mysql> SELECT SUBSTRING('Sakila' FROM -4 FOR 2); -> 'ki'

It contains linebreaks __NEWLINE__ and prefix mysql>.

Instead, this would be much more readable:

SUBSTRING(str,pos), SUBSTRING(str FROM pos), SUBSTRING(str,pos,len), SUBSTRING(str FROM pos FOR len):

SELECT SUBSTRING('Quadratically',5); -> 'ratically'
SELECT SUBSTRING('foobarbar' FROM 4); -> 'barbar'
SELECT SUBSTRING('Quadratically',5,6); -> 'ratica'
SELECT SUBSTRING('Sakila', -3); -> 'ila'
SELECT SUBSTRING('Sakila', -5, 3); -> 'aki'
SELECT SUBSTRING('Sakila' FROM -4 FOR 2); -> 'ki'

IA Page: http://duck.co/ia/view/my_sql

@ghost ghost changed the title MySQL: linebreaks '__NEWLINE__' and prefix 'mysql>' shown in example view MySQL: linebreaks __NEWLINE__ and prefix 'mysql>' shown in example view Aug 4, 2015
@moollaza
Copy link
Member

@FCTURNER thanks for reporting! I think someone should be able to update the parser for this Instant Answer so that it displays the result with newlines

@moollaza
Copy link
Member

Crap, looks like this is an internal IA. We'll have to do it ourselves I guess.

@jdorweiler do you have any idea if we can open source this IA? Should we ask the community to re-implement it themselves?

@jdorweiler
Copy link
Contributor

I think this is it. Unfortunatly, I don't think it's working. https://github.com/duckduckgo/zeroclickinfo-fathead/blob/master/lib/fathead/UNCLEAN/parse_mysqlfunction.py

@pjhampton
Copy link
Contributor

Passing comments to internal team.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants