Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MySQL parsing bug: error in SQL syntax near '$$' #2807

Closed
MikielAgutu opened this issue May 5, 2020 · 0 comments
Closed

MySQL parsing bug: error in SQL syntax near '$$' #2807

MikielAgutu opened this issue May 5, 2020 · 0 comments
Assignees
Milestone

Comments

@MikielAgutu
Copy link

MikielAgutu commented May 5, 2020

Original context #2798 (comment)

delimiter $$

-- /*=========================================================================*/

drop function if exists column_exists $$

create function column_exists
(
	table_in	varchar(64),
	column_in	varchar(64)
)
returns bool
deterministic
begin
	set @column_count =
	(
		select count(*)
		from information_schema.columns
		where table_name = table_in
		and column_name = column_in
		and table_schema = database()
	);

	return (@column_count > 0);
end $$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants