![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
flex (flex version 2.5.4) incorporates case-insensitivity in it's state tables because if I run flex stage with LANG=C everything works fine. |
|
A quick and dirty fix could be implemented by placing LANG=C export LANG in file src/pl/plpgsql/src/Makefile before calling flex. |
#3
| |||
| |||
|
|
I attached a diff of fix that adds LANG=C; before call to $(FLEX). Fixes the problem here but I don't know if adding environment variable assignment like this is appropriate. I am not too fluent in PostgreSQL build environment and do not know where one can put a global deffinition you are talking below. |
#4
| |||
| |||
|
|
ntufar <ntufar (AT) pisem (DOT) net> writes: I attached a diff of fix that adds LANG=C; before call to $(FLEX). Fixes the problem here but I don't know if adding environment variable assignment like this is appropriate. I am not too fluent in PostgreSQL build environment and do not know where one can put a global deffinition you are talking below. Um, the attachment was unreadable :-( but I get the idea. |
|
As for the global solution, I was wondering if it would work to put "LANG=C" right inside the definition of $(FLEX). That would ensure the right behavior from all our flex builds without unnecessarily messing up people's build environments otherwise. I don't know however whether this would parse properly. |
|
regards, tom lane |
#5
| |||
| |||
|
|
flex (flex version 2.5.4) incorporates case-insensitivity in it's state tables because if I run flex stage with LANG=C everything works fine. Ick. That is of course why it worked for me when I tested it :-( A quick and dirty fix could be implemented by placing LANG=C export LANG in file src/pl/plpgsql/src/Makefile before calling flex. This is probably what we'd better do. Otherwise we have build-context-dependency in the system's behavior, which is bad. I attached a diff of fix that adds LANG=C; before call to $(FLEX). |
|
plpgsql's scan.l seems to be the only use of '%option case-insensitive' but we have enough flex lexers laying about that I wouldn't be surprised to have this same risk elsewhere. Is it reasonable to try to force LANG=C in some global fashion during the build? regards, tom lane Best regards, |
#6
| |||
| |||
|
|
Peter, any thoughts on this one way or the other? At the moment plpgsql's scan.l seems to be the only use of '%option case-insensitive' but we have enough flex lexers laying about that I wouldn't be surprised to have this same risk elsewhere. Is it reasonable to try to force LANG=C in some global fashion during the build? |
#7
| |||
| |||
|
|
Apparently problem is caused by the following directive: %option case-insensitive on line 76 in file src/pl/plpgsql/src/scan.l flex (flex version 2.5.4) incorporates case-insensitivity in it's state tables because if I run flex stage with LANG=C everything works fine. A quick and dirty fix could be implemented by placing LANG=C export LANG in file src/pl/plpgsql/src/Makefile before calling flex. |
#8
| |||
| |||
|
|
You'd have to set LC_ALL=C to be really sure to override everything. But I would stay away from doing that globally, because all the translation work in gcc and make would go to waste. |
|
I would also suggest that Nicolai report this issue to the flex developers. It's only bound to reappear everywhere case-insensitive flex scanners are used. |
#9
| |||
| |||
|
|
I have tried running flex (2.5.4) with a number of different locales including tr_TR, but the output file is always the same. Can you show us a diff of the generated files? |
#10
| |||
| |||
|
|
flex (flex version 2.5.4) incorporates case-insensitivity in it's state tables because if I run flex stage with LANG=C everything works fine. Ick. That is of course why it worked for me when I tested it :-( |
![]() |
| Thread Tools | |
| Display Modes | |
| |