ny_quant: (Default)
[personal profile] ny_quant
У нас в отделе есть некая аппликация собственной внутренней разработки, где в одном месте тебе не просто показывают то что хотел бы увидеть, но и заодно как бы мета-SQL query, которую можно потом вручную подкрутить, чтобы получить ещё-более интересные результаты. Почему мета а не просто SQL? Наверное чтобы кто-нибудь случайно в базе не напортачил.

Намедни я в это место сдуру кликнул. Результат получился настолько парадоксальный, что я стал читать этот SQL и с удивлением обнаружил вот такую часть запроса:

... and "Status" "is" "Active" and "Status" "is" "Inactive" ...

От изумления написал вопрос в службу поддержки. Поступил ответ:

Ignore. The team is following up with tech as the “and” is probably not working as expected.

Прибалдел. Можно даже сказать - пришел в должностной восторг.

Date: 2017-10-05 11:25 pm (UTC)
From: [identity profile] vnarod.livejournal.com
При таком запросе ты вообще не должен был результат получить.

Date: 2017-10-06 01:06 am (UTC)
From: [identity profile] ny-quant.livejournal.com
Спасибо, капитан. У мея есть хорошее название для твоего корабля. На букву О

Date: 2017-10-06 03:48 am (UTC)
From: [identity profile] vnarod.livejournal.com
Ты посто написал "Результат получился настолько парадоксальны", что подразумевает что результат не пустой

Date: 2017-10-06 04:30 am (UTC)
From: [identity profile] ny-quant.livejournal.com
Exactly right. Но просто не пустой, а ещё и парадоксальный.

Date: 2017-10-06 01:23 pm (UTC)
From: [identity profile] eugene naumovich (from livejournal.com)
Вы во неправильной прадигме, потому как полагаете, что "Status" - boolean. A он может enum, и кроме "Active", "Inactive" может быть ещё "Deleted", "Locked" и "Unknown".
Edited Date: 2017-10-06 01:24 pm (UTC)

Date: 2017-10-06 03:29 pm (UTC)
From: [identity profile] ny-quant.livejournal.com
Ви таки мне будете расказывать за наши статусы?

Date: 2017-10-06 03:44 pm (UTC)
From: [identity profile] eugene naumovich (from livejournal.com)
А вы твердо стоите на том, что это "статусы" ваши, а не аутсорсера из Мумбая?

Date: 2017-10-06 12:20 am (UTC)
From: [identity profile] sydorov47.livejournal.com
Если трансляция из "мета" в SQL не проверяет текст, и запрос отрабатывает завышеными привелегиями, то там базу и скопировать, и удалить может получитья.

Date: 2017-10-06 01:06 am (UTC)
From: [identity profile] ny-quant.livejournal.com
А вот это идея!
From: [identity profile] eugene naumovich (from livejournal.com)
Это называется "code injection" и является одним из 7 каноничных путей в Адъ.
From: [identity profile] sydorov47.livejournal.com
Путей 10. Пророк OWASP их изрекает раз в год.

Date: 2017-10-06 12:25 am (UTC)
From: [identity profile] stumari.livejournal.com
I think it really depends on what the meaning of the word "is" is
and, of course, the same about the "and"

Date: 2017-10-06 01:11 am (UTC)

Date: 2017-10-06 04:04 am (UTC)
From: [identity profile] stan podolski (from livejournal.com)
And maybe "Status" is from quantum calculations and therefore can be Active and Inactive at the same time

Date: 2017-10-06 04:16 am (UTC)
From: [identity profile] stumari.livejournal.com
Quantum programming

Date: 2017-10-06 04:31 am (UTC)

Date: 2017-10-06 01:30 pm (UTC)
From: [identity profile] nlothik.livejournal.com
Not only that, but it also depends on whether the status is being observed.

Date: 2017-10-06 04:32 pm (UTC)
From: [identity profile] silugram.livejournal.com
Это как "to be or not to be" is always true.

Profile

ny_quant: (Default)
ny_quant

January 2026

S M T W T F S
    123
45 6 7 8 9 10
11 12 13 14 151617
1819 20 21 22 2324
25262728293031

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jan. 24th, 2026 09:22 am
Powered by Dreamwidth Studios