Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3de1f0d

Browse files
committed
Fix XML tag namespace change inadvertantly missed from previous fix. Add
regression test for XML names and numeric entities.
1 parenta999ff6 commit3de1f0d

File tree

3 files changed

+27
-3
lines changed

3 files changed

+27
-3
lines changed

‎src/backend/tsearch/wparser_def.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $PostgreSQL: pgsql/src/backend/tsearch/wparser_def.c,v 1.11 2007/11/20 02:25:22 adunstan Exp $
10+
* $PostgreSQL: pgsql/src/backend/tsearch/wparser_def.c,v 1.12 2007/11/25 15:37:11 adunstan Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -827,7 +827,6 @@ static const TParserStateActionItem actionTPS_InXMLEntity[] = {
827827
{p_isalnum,0,A_NEXT,TPS_InXMLEntity,0,NULL},
828828
{p_iseqC,':',A_NEXT,TPS_InXMLEntity,0,NULL},
829829
{p_iseqC,'_',A_NEXT,TPS_InXMLEntity,0,NULL},
830-
{p_iseqC,':',A_NEXT,TPS_InXMLEntity,0,NULL},
831830
{p_iseqC,'.',A_NEXT,TPS_InXMLEntity,0,NULL},
832831
{p_iseqC,'-',A_NEXT,TPS_InXMLEntity,0,NULL},
833832
{p_iseqC,';',A_NEXT,TPS_InXMLEntityEnd,0,NULL},
@@ -871,6 +870,8 @@ static const TParserStateActionItem actionTPS_InTagFirst[] = {
871870
{p_iseqC,'!',A_PUSH,TPS_InCommentFirst,0,NULL},
872871
{p_iseqC,'?',A_PUSH,TPS_InXMLBegin,0,NULL},
873872
{p_isasclet,0,A_PUSH,TPS_InTagName,0,NULL},
873+
{p_iseqC,':',A_PUSH,TPS_InTagName,0,NULL},
874+
{p_iseqC,'_',A_PUSH,TPS_InTagName,0,NULL},
874875
{NULL,0,A_POP,TPS_Null,0,NULL}
875876
};
876877

@@ -894,7 +895,11 @@ static const TParserStateActionItem actionTPS_InTagName[] = {
894895
{p_iseqC,'/',A_NEXT,TPS_InTagBeginEnd,0,NULL},
895896
{p_iseqC,'>',A_NEXT,TPS_InTagEnd,0,SpecialTags},
896897
{p_isspace,0,A_NEXT,TPS_InTag,0,SpecialTags},
897-
{p_isasclet,0,A_NEXT,TPS_Null,0,NULL},
898+
{p_isalnum,0,A_NEXT,TPS_Null,0,NULL},
899+
{p_iseqC,':',A_NEXT,TPS_Null,0,NULL},
900+
{p_iseqC,'_',A_NEXT,TPS_Null,0,NULL},
901+
{p_iseqC,'.',A_NEXT,TPS_Null,0,NULL},
902+
{p_iseqC,'-',A_NEXT,TPS_Null,0,NULL},
898903
{NULL,0,A_POP,TPS_Null,0,NULL}
899904
};
900905

‎src/test/regress/expected/tsearch.out

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,21 @@ SELECT length(to_tsvector('english', '345 qwe@efd.r '' http://www.com/ http://ae
391391
51
392392
(1 row)
393393

394+
-- ts_debug
395+
SELECT * from ts_debug('<myns:foo-bar_baz.blurfl>abc&nm1;def&#xa9;ghi&#245;jkl</myns:foo-bar_baz.blurfl>');
396+
alias | description | token | dictionaries | dictionary | lexemes
397+
-----------+-----------------+----------------------------+----------------+--------------+---------
398+
tag | XML tag | <myns:foo-bar_baz.blurfl> | {} | |
399+
asciiword | Word, all ASCII | abc | {english_stem} | english_stem | {abc}
400+
entity | XML entity | &nm1; | {} | |
401+
asciiword | Word, all ASCII | def | {english_stem} | english_stem | {def}
402+
entity | XML entity | &#xa9; | {} | |
403+
asciiword | Word, all ASCII | ghi | {english_stem} | english_stem | {ghi}
404+
entity | XML entity | &#245; | {} | |
405+
asciiword | Word, all ASCII | jkl | {english_stem} | english_stem | {jkl}
406+
tag | XML tag | </myns:foo-bar_baz.blurfl> | {} | |
407+
(9 rows)
408+
394409
-- to_tsquery
395410
SELECT to_tsquery('english', 'qwe & sKies ');
396411
to_tsquery

‎src/test/regress/sql/tsearch.sql

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ SELECT length(to_tsvector('english', '345 qwe@efd.r '' http://www.com/ http://ae
9898
/usr/local/fff /awdf/dwqe/4325 rewt/ewr wefjn /wqe-324/ewr gist.h gist.h.c gist.c. readline 4.2 4.2. 4.2, readline-4.2 readline-4.2. 234
9999
<i <b> wow < jqw <> qwerty'));
100100

101+
-- ts_debug
102+
103+
SELECT*from ts_debug('<myns:foo-bar_baz.blurfl>abc&nm1;def&#xa9;ghi&#245;jkl</myns:foo-bar_baz.blurfl>');
104+
101105
-- to_tsquery
102106

103107
SELECT to_tsquery('english','qwe & sKies');

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp