- Package:
- qa.debian.org
- Source:
- qa.debian.org
- Submitter:
- Andreas Tille
- Date:
- 2024-02-27 17:48:07 UTC
- Severity:
- normal
Hi,
in some tables names are not stripped from spaces. Example:
udd=> select '"' || u.name || '"' as name_with_spaces, uploader from uploaders u where name like '% ' or name like ' %' ;
name_with_spaces | uploader
--------------------------+-------------------------------------------
" Mehdi Dogguy" | Mehdi Dogguy <mehdi@debian.org>
" David Paleino" | David Paleino <dapal@debian.org>
" Stéphane Glondu" | Stéphane Glondu <glondu@debian.org>
" Stefano Zacchiroli" | Stefano Zacchiroli <zack@debian.org>
" Stefano Zacchiroli" | Stefano Zacchiroli <zack@debian.org>
" Stefano Zacchiroli" | Stefano Zacchiroli <zack@debian.org>
" Stefano Zacchiroli" | Stefano Zacchiroli <zack@debian.org>
" Stefano Zacchiroli" | Stefano Zacchiroli <zack@debian.org>
"Andreas Tille " | Andreas Tille <tille@debian.org>
" LI Daobing" | LI Daobing <lidaobing@debian.org>
" David Paleino" | David Paleino <dapal@debian.org>
" Stefano Zacchiroli" | Stefano Zacchiroli <zack@debian.org>
" Nikita V. Youshchenko" | Nikita V. Youshchenko <yoush@debian.org>
" Nikita V. Youshchenko" | Nikita V. Youshchenko <yoush@debian.org>
" Nikita V. Youshchenko" | Nikita V. Youshchenko <yoush@debian.org>
" Nikita V. Youshchenko" | Nikita V. Youshchenko <yoush@debian.org>
" Nikita V. Youshchenko" | Nikita V. Youshchenko <yoush@debian.org>
"Colin Tuckley " | Colin Tuckley <colint@debian.org>
"Colin Tuckley " | Colin Tuckley <colint@debian.org>
"Colin Tuckley " | Colin Tuckley <colint@debian.org>
(20 rows)
in other tables names are containing quotes that should be stripped as well:
select distinct done, done_name, done_email, owner, owner_name, owner_email from archived_bugs where done_name like '%"%' or owner_name like '%"%' order by done_name;
done | done_name | done_email | owner | owner_name | owner_email
---------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------+-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------+----------------------------------------------
<dererk@debian.org> | | dererk@debian.org | "vanecgs@gmail.com" <vanecgs@gmail.com> | "vanecgs@gmail.com" | vanecgs@gmail.com
<twerner@debian.org> | | twerner@debian.org | "Varun Hiremath" <varunhiremath@gmail.com> | "Varun Hiremath" | varunhiremath@gmail.com
alexander@belikoff.net (Alexander L. Belikoff) | | alexander@belikoff.net | "Alexander L. Belikoff" <alexander@belikoff.net> | "Alexander L. Belikoff" | alexander@belikoff.net
andi@debian.org (Andreas B. Mundt) | | andi@debian.org | "Andreas B. Mundt" <andi@debian.org> | "Andreas B. Mundt" | andi@debian.org
antoine.romain.dumont@gmail.com (Antoine R. Dumont (@ardumont)) | | antoine.romain.dumont@gmail.com | "Antoine R. Dumont" <antoine.romain.dumont@gmail.com> | "Antoine R. Dumont" | antoine.romain.dumont@gmail.com
antoine.romain.dumont@gmail.com (Antoine R. Dumont) | | antoine.romain.dumont@gmail.com | "Antoine R. Dumont" <antoine.romain.dumont@gmail.com> | "Antoine R. Dumont" | antoine.romain.dumont@gmail.com
arturcz@hell.pl (Artur R. Czechowski) | | arturcz@hell.pl | "Artur R. Czechowski" <arturcz@hell.pl> | "Artur R. Czechowski" | arturcz@hell.pl
...
IMHO the parser should strip spaces and quotes that can be found at beginning and end of strings.
Kind regards
Andreas.
The problem was discussed on Debian-QA list. The discussion starts here: https://lists.debian.org/debian-qa/2023/12/msg00007.html I opened this bug report to keep a record of the discussion in BTS. There is one statement by Lucas Nussbaum[1] defending the current situation: I do not consider strings injected into a database are comparable to an API. The fact that this issue exists since 15 years does not mean that it is the right way to do. Some bugs are just discovered after that long time since the trigger for the issue might be quite rare. I personally do not see any potential break of any application by stripping names to be more easily parseable. I'd be happy if someone could convince me otherwise by for instance describing applications that are relying on different spellings of the very same name. Kind regards Andreas. [1] https://lists.debian.org/debian-qa/2023/12/msg00016.html