greenplumn parse_keyword 源码

  • 2022-08-18
  • 浏览 (514)

greenplumn parse_keyword 代码

文件路径:/gpcontrib/orafce/parse_keyword.c

#include "postgres.h"

#include "parse_keyword.h"

#include "parser/gramparse.h"

#if PG_VERSION_NUM >= 90600

#include "common/keywords.h"

#else

#include "parser/keywords.h"

#endif

#if PG_VERSION_NUM >= 120000

const char *
orafce_scan_keyword(const char *text, int *keycode)
{
	int		kwnum;

	kwnum = ScanKeywordLookup(text, &ScanKeywords);
	if (kwnum >= 0)
	{
		*keycode = ScanKeywordTokens[kwnum];
		return GetScanKeyword(kwnum, &ScanKeywords);
	}

	return NULL;
}

#else

const char *
orafce_scan_keyword(const char *text, int *keycode)
{
	const ScanKeyword *keyword;

	keyword = ScanKeywordLookup(text, ScanKeywords, NumScanKeywords);
	if (keyword)
	{
		*keycode = keyword->value;
		return keyword->name;
	}

	return NULL;
}

#endif

相关信息

greenplumn 源码目录

相关文章

greenplumn aggregate 源码

greenplumn alert 源码

greenplumn assert 源码

greenplumn assert 源码

greenplumn builtins 源码

greenplumn charlen 源码

greenplumn charpad 源码

greenplumn convert 源码

greenplumn datefce 源码

greenplumn file 源码

0  赞