mirror of
https://github.com/postgres/postgres.git
synced 2025-06-30 21:42:05 +03:00
Be pickier about converting between Name and Datum.
We were misapplying NameGetDatum() to plain C strings in some places. This worked, because it was just a pointer cast anyway, but it's a type cheat in some sense. Use CStringGetDatum instead, and modify the NameGetDatum macro so it won't compile if applied to something that's not a pointer to NameData. This should result in no changes to generated code, but it is logically cleaner. Mark Dilger, tweaked a bit by me Discussion: <EFD8AC94-4C1F-40C1-A5EA-304080089C1B@gmail.com>
This commit is contained in:
@ -463,7 +463,7 @@ find_language_template(const char *languageName)
|
||||
ScanKeyInit(&key,
|
||||
Anum_pg_pltemplate_tmplname,
|
||||
BTEqualStrategyNumber, F_NAMEEQ,
|
||||
NameGetDatum(languageName));
|
||||
CStringGetDatum(languageName));
|
||||
scan = systable_beginscan(rel, PLTemplateNameIndexId, true,
|
||||
NULL, 1, &key);
|
||||
|
||||
|
Reference in New Issue
Block a user