Skip to content

adding features BTRIM, LTRIM, RTRIM#1

Open
MrTeeett wants to merge 20 commits intomasterfrom
redos
Open

adding features BTRIM, LTRIM, RTRIM#1
MrTeeett wants to merge 20 commits intomasterfrom
redos

Conversation

@MrTeeett
Copy link
Owner

@MrTeeett MrTeeett commented Nov 9, 2023

No description provided.

<trim character> ::=
<value expression>

<multi-character trim function> ::=

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

отступ неправильный, как будто это продолжение обычной функции TRIM

select
ltrim(rdb$relation_name, 'RDB$')
from rdb$relations
where rdb$relation_name starting with 'RDB$';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Пример не самый удачный, по-моему.
Выглядит будто эта строка и будет отрезаться целиком. А не отдельные символы из неё.

src/dsql/parse.y Outdated
| WINDOW
| WITHOUT
| CALL // added in FB 6.0
| BTRIM

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тут тоже с отступом что-то не то или это github так показывает?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

здесь отступ в коде корректный, наверное github что-то не так показывает
image

break;
}
}
{

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Не понял смысла изменений. Мы добавили ещё один блок, который никак ни на что не влияет?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

в коде у меня здесь все нормально, я не знаю почему так в коммите изменения были указаны(может когда я в самом начале праил код, то сначала удалил эту скобку, а потом заново поставил и она записалась в изменение).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ну вот сейчас здесь все то же самое. блок никуда не делся

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

while (offsetLead < valueCanonicalLen)
{
bool found = false;
for (int i = 0; i < charactersCanonicalLen; i+=4)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

откуда здесь +=4? почему мы так перескакиваем по строке?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

как я понял здесь каждая буква записывается по 4 бита, поэтому и +4 так как если ставить меньше он несколько раз одну букву будит смотреть

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Во-первых, не бита, а байта. Во-вторых, длина символов не 4, а charactersCanonicalLen, как я понимаю из оригинального кода

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

здесь все исправил теперь работает корректно

where rdb$system_flag = 1;

C)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

зачем тут пустая строка?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

только здесь не понимаю, тут не нужна 42 пустая строка?


C)

select

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

отступ лишний

select
ltrim('baobab is a tree', 'aboe')
from rdb$relations;
is a tree

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

в других примерах нет результата, тут смотрится непонятно

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants