MonetDB: comment-on - Use separate SQLstatementIntern to SET sys...

Sjoerd Mullender sjoerd at monetdb.org
Fri Jan 12 15:07:40 CET 2018


On 12/01/18 14:55, Joeri van Ruth wrote:
> Changeset: ae04d7842803 for MonetDB
> URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ae04d7842803
> Modified Files:
> 	sql/backends/monet5/sql_upgrades.c
> Branch: comment-on
> Log Message:
> 
> Use separate SQLstatementIntern to SET sys.keywords READ ONLY
> 
> Hopefully this fixes the upgrade failures.

It doesn't. :-(

> 
> 
> diffs (45 lines):
> 
> diff --git a/sql/backends/monet5/sql_upgrades.c b/sql/backends/monet5/sql_upgrades.c
> --- a/sql/backends/monet5/sql_upgrades.c
> +++ b/sql/backends/monet5/sql_upgrades.c
> @@ -1070,12 +1070,12 @@ sql_remove_environment_func(Client c, mv
>  static str
>  sql_create_comments_table(Client c)
>  {
> -	char *err, *q1, *q2;
> +	char *err, *q;
>  
> -	q1 = ""
> +	q = ""
>  		"ALTER TABLE sys.keywords SET READ WRITE;\n"
>  		"INSERT INTO sys.keywords VALUES ('COMMENT');\n"
> -		"ALTER TABLE sys.keywords SET READ ONLY;\n"
> +		"-- ALTER TABLE sys.keywords SET READ ONLY;\n"
>  		"\n"
>  		"CREATE TABLE sys.comments (\n"
>  		"        id INTEGER NOT NULL PRIMARY KEY,\n"
> @@ -1223,16 +1223,22 @@ sql_create_comments_table(Client c)
>  		"FROM commented_function_params\n"
>  		"ORDER BY line;\n"
>  		"GRANT SELECT ON sys.commented_function_signatures TO PUBLIC;\n";
> -	err = SQLstatementIntern(c, &q1, "update", 1, 0, NULL);
> +	err = SQLstatementIntern(c, &q, "update", 1, 0, NULL);
>  	if (err)
>  		return err;
>  
> -	q2 = ""
> +	q = ""
>  		"UPDATE sys._tables\n"
>  		"SET system = true\n"
>  		"WHERE name = 'comments'\n"
>  		"AND schema_id = (SELECT id FROM sys.schemas WHERE name = 'sys');\n";
> -	return SQLstatementIntern(c, &q2, "update", 1, 0, NULL);
> +
> +	err = SQLstatementIntern(c, &q, "update", 1, 0, NULL);
> +	if (err)
> +		return err;
> +
> +	q = "ALTER TABLE sys.keywords SET READ ONLY;";
> +	return SQLstatementIntern(c, &q, "update", 1, 0, NULL);
>  }
>  
>  void
> _______________________________________________
> checkin-list mailing list
> checkin-list at monetdb.org
> https://www.monetdb.org/mailman/listinfo/checkin-list
> 


-- 
Sjoerd Mullender

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://www.monetdb.org/pipermail/developers-list/attachments/20180112/90f60608/attachment.sig>


More information about the developers-list mailing list