mirror of
				https://github.com/postgres/postgres.git
				synced 2025-11-03 09:13:20 +03:00 
			
		
		
		
	ECPG: Fix searching for quoted cursor names case-sensitively.
Patch by Böszörményi Zoltán <zb@cybertec.at>
This commit is contained in:
		@@ -290,7 +290,7 @@ ECPG: DeclareCursorStmtDECLAREcursor_namecursor_optionsCURSORopt_holdFORSelectSt
 | 
				
			|||||||
		struct cursor *ptr, *this;
 | 
							struct cursor *ptr, *this;
 | 
				
			||||||
		char *cursor_marker = $2[0] == ':' ? mm_strdup("$0") : mm_strdup($2);
 | 
							char *cursor_marker = $2[0] == ':' ? mm_strdup("$0") : mm_strdup($2);
 | 
				
			||||||
		char *comment, *c1, *c2;
 | 
							char *comment, *c1, *c2;
 | 
				
			||||||
		int (* strcmp_fn)(const char *, const char *) = ($2[0] == ':' ? strcmp : pg_strcasecmp);
 | 
							int (* strcmp_fn)(const char *, const char *) = (($2[0] == ':' || $2[0] == '"') ? strcmp : pg_strcasecmp);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		for (ptr = cur; ptr != NULL; ptr = ptr->next)
 | 
							for (ptr = cur; ptr != NULL; ptr = ptr->next)
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -492,7 +492,7 @@ add_additional_variables(char *name, bool insert)
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
	struct cursor *ptr;
 | 
						struct cursor *ptr;
 | 
				
			||||||
	struct arguments *p;
 | 
						struct arguments *p;
 | 
				
			||||||
	int (* strcmp_fn)(const char *, const char *) = (name[0] == ':' ? strcmp : pg_strcasecmp);
 | 
						int (* strcmp_fn)(const char *, const char *) = ((name[0] == ':' || name[0] == '"') ? strcmp : pg_strcasecmp);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	for (ptr = cur; ptr != NULL; ptr=ptr->next)
 | 
						for (ptr = cur; ptr != NULL; ptr=ptr->next)
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -291,7 +291,7 @@ ECPGCursorStmt:  DECLARE cursor_name cursor_options CURSOR opt_hold FOR prepared
 | 
				
			|||||||
		{
 | 
							{
 | 
				
			||||||
			struct cursor *ptr, *this;
 | 
								struct cursor *ptr, *this;
 | 
				
			||||||
			char *cursor_marker = $2[0] == ':' ? mm_strdup("$0") : mm_strdup($2);
 | 
								char *cursor_marker = $2[0] == ':' ? mm_strdup("$0") : mm_strdup($2);
 | 
				
			||||||
			int (* strcmp_fn)(const char *, const char *) = ($2[0] == ':' ? strcmp : pg_strcasecmp);
 | 
								int (* strcmp_fn)(const char *, const char *) = (($2[0] == ':' || $2[0] == '"') ? strcmp : pg_strcasecmp);
 | 
				
			||||||
			struct variable *thisquery = (struct variable *)mm_alloc(sizeof(struct variable));
 | 
								struct variable *thisquery = (struct variable *)mm_alloc(sizeof(struct variable));
 | 
				
			||||||
			const char *con = connection ? connection : "NULL";
 | 
								const char *con = connection ? connection : "NULL";
 | 
				
			||||||
			char *comment;
 | 
								char *comment;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user