Changeset: e76a2b4354ce for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/e76a2b4354ce
Modified Files:
        sql/backends/monet5/sql_upgrades.c
        sql/scripts/22_clients.sql
Branch: clientinfo
Log Message:

Add a system table that lists the supported client info properties


diffs (37 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
@@ -7133,7 +7133,15 @@ sql_update_default(Client c, mvc *sql, s
                        "create procedure sys.setclientinfo(property string, 
value string)\n"
                        " external name clients.setinfo;\n"
                        "grant execute on procedure sys.setclientinfo(string, 
string) to public;\n"
-                       "update sys.functions set system = true where schema_id 
= 2000 and name in ('setclientinfo', 'sessions');";
+                       "create table sys.clientinfo_properties(prop string);\n"
+                       "insert into sys.clientinfo_properties values\n"
+                       " ('ClientHostname'),\n"
+                       " ('ApplicationName'),\n"
+                       " ('ClientLibrary'),\n"
+                       " ('ClientRemark'),\n"
+                       " ('ClientPid');\n"
+                       "update sys.functions set system = true where schema_id 
= 2000 and name in ('setclientinfo', 'sessions');\n"
+                       "update sys._tables set system = true where schema_id = 
2000 and name = 'clientinfo_properties';\n";
                        ;
                sql_schema *sys = mvc_bind_schema(sql, "sys");
                sql_table *t = mvc_bind_table(sql, sys, "sessions");
diff --git a/sql/scripts/22_clients.sql b/sql/scripts/22_clients.sql
--- a/sql/scripts/22_clients.sql
+++ b/sql/scripts/22_clients.sql
@@ -44,6 +44,13 @@ create view sys.sessions as select * fro
 create procedure sys.setclientinfo(property string, value string)
        external name clients.setinfo;
 grant execute on procedure sys.setclientinfo(string, string) to public;
+create table sys.clientinfo_properties(prop string);
+insert into sys.clientinfo_properties values
+       ('ClientHostname'),
+       ('ApplicationName'),
+       ('ClientLibrary'),
+       ('ClientRemark'),
+       ('ClientPid');
 
 -- routines to bring the system down quickly
 create procedure sys.shutdown(delay tinyint)
_______________________________________________
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org

Reply via email to