1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-30 11:03:19 +03:00

Change tsearch2 to not use the unsafe practice of creating functions

that return INTERNAL without also having INTERNAL arguments.  Since the
functions in question aren't meant to be called by hand anyway, I just
redeclared them to take 'internal' instead of 'text'.  Also add code
to ProcedureCreate() to enforce the restriction, as I should have done
to start with :-(
This commit is contained in:
Tom Lane
2005-05-03 16:51:45 +00:00
parent a935e36ae9
commit 308f01c304
4 changed files with 36 additions and 27 deletions

View File

@ -1,7 +1,7 @@
SET search_path = public;
BEGIN;
HASINIT create function dinit_CFG_MODNAME(text)
HASINIT create function dinit_CFG_MODNAME(internal)
HASINIT returns internal
HASINIT as 'MODULE_PATHNAME'
HASINIT language 'C';

View File

@ -44,7 +44,7 @@ CREATE FUNCTION set_curdict(text)
with (isstrict);
--built-in dictionaries
CREATE FUNCTION dex_init(text)
CREATE FUNCTION dex_init(internal)
returns internal
as 'MODULE_PATHNAME'
language 'C';
@ -63,7 +63,7 @@ insert into pg_ts_dict select
'Simple example of dictionary.'
;
CREATE FUNCTION snb_en_init(text)
CREATE FUNCTION snb_en_init(internal)
returns internal
as 'MODULE_PATHNAME'
language 'C';
@ -82,7 +82,7 @@ insert into pg_ts_dict select
'English Stemmer. Snowball.'
;
CREATE FUNCTION snb_ru_init(text)
CREATE FUNCTION snb_ru_init(internal)
returns internal
as 'MODULE_PATHNAME'
language 'C';
@ -95,7 +95,7 @@ insert into pg_ts_dict select
'Russian Stemmer. Snowball.'
;
CREATE FUNCTION spell_init(text)
CREATE FUNCTION spell_init(internal)
returns internal
as 'MODULE_PATHNAME'
language 'C';
@ -114,7 +114,7 @@ insert into pg_ts_dict select
'ISpell interface. Must have .dict and .aff files'
;
CREATE FUNCTION syn_init(text)
CREATE FUNCTION syn_init(internal)
returns internal
as 'MODULE_PATHNAME'
language 'C';

View File

@ -34,14 +34,14 @@ DROP FUNCTION lexize(text, text);
DROP FUNCTION lexize(text);
DROP FUNCTION set_curdict(int);
DROP FUNCTION set_curdict(text);
DROP FUNCTION dex_init(text);
DROP FUNCTION dex_init(internal);
DROP FUNCTION dex_lexize(internal,internal,int4);
DROP FUNCTION snb_en_init(text);
DROP FUNCTION snb_en_init(internal);
DROP FUNCTION snb_lexize(internal,internal,int4);
DROP FUNCTION snb_ru_init(text);
DROP FUNCTION spell_init(text);
DROP FUNCTION snb_ru_init(internal);
DROP FUNCTION spell_init(internal);
DROP FUNCTION spell_lexize(internal,internal,int4);
DROP FUNCTION syn_init(text);
DROP FUNCTION syn_init(internal);
DROP FUNCTION syn_lexize(internal,internal,int4);
DROP FUNCTION set_curprs(int);
DROP FUNCTION set_curprs(text);