Sorry for wrong suggestion. Setting in_quote is wrong there because it's
before the beginning quote. Although, advancing read pointer and replacing
c with the next value is still needed.

regards,
--
Kyotaro Horiguchi
NTT Open Source Software Center
2014/09/09 20:49 "Kyotaro HORIGUCHI" <horiguchi.kyot...@lab.ntt.co.jp>:

> Hello, I will be the reviewer of this patch.
>
> You approach that coloring tokens seems right, but you have
> broken the parse logic by adding your code.
>
> Other than the mistakes others pointed, I found that
>
> - non-SQL-ident like tokens are ignored by their token style,
>   quoted or not, so the following line works.
>
> | "local" All aLL trust
>
> I suppose this is not what you intended. This is because you have
> igonred the attribute of a token when comparing it as
> non-SQL-ident tokens.
>
>
> - '+' at the head of the sequence '+"' is treated as the first
>   character of the *quoted* string. e.g. +"hoge" is tokenized as
>   "+hoge":special_quoted.
>
> This is why you simply continued processing for '+"' without
> discarding and skipping the '+', and not setting in_quote so the
> following parser code works as it is not intended. You should
> understand what the original code does and insert or modify
> logics not braeking the assumptions.
>
> > > With this patch, database (and role?) names are compared
> case-insensitively.
> > > For example:
> > >
> > > local  MixedDB all trust
> > > local  mixedDB all reject
> > >
> > > psql -d "mixedDB"
> > > psql (9.5devel)
> > > Type "help" for help.
> > >
> > > mixedDB=#
> > >
> > > That connection should've matched that 2nd line, and be rejected.
> >
> > Actually it should have matched neither, as both lines will get folded
> > downcase:
> >
> > local  mixeddb all trust
> > local  mixeddb all reject
>
> regards,
>
> --
> Kyotaro Horiguchi
> NTT Open Source Software Center
>
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>

Reply via email to