@@ -123,9 +123,22 @@ echo "select case when i > 100 then 200 else f2(f1(100)) end as c1 from t;" | $T
123
123
echo " select case when i > 100 then f2(f1(200)) else 100 end as c1 from t;" | $TEST_USER_CONNECT
124
124
echo " delete from t;" | $TEST_USER_CONNECT
125
125
126
+ # udf server test
127
+ echo " drop function if exists a;" | $BENDSQL_CLIENT_CONNECT
128
+ echo " drop function if exists b;" | $BENDSQL_CLIENT_CONNECT
129
+ echo " CREATE FUNCTION a (TINYINT, SMALLINT, INT, BIGINT) RETURNS BIGINT LANGUAGE python HANDLER = 'add_signed' ADDRESS = 'http://0.0.0.0:8815';" | $BENDSQL_CLIENT_CONNECT
130
+ echo " CREATE FUNCTION b (TINYINT, SMALLINT, INT, BIGINT) RETURNS BIGINT LANGUAGE python HANDLER = 'add_signed' ADDRESS = 'http://0.0.0.0:8815';" | $BENDSQL_CLIENT_CONNECT
131
+
132
+ echo " grant usage on udf a to 'test-user'" | $BENDSQL_CLIENT_CONNECT
133
+ echo " select a(1,1,1,1)" | $TEST_USER_CONNECT
134
+ echo " select b(1,1,1,1)" | $TEST_USER_CONNECT
135
+
136
+
126
137
echo " drop user if exists 'test-user'" | $BENDSQL_CLIENT_CONNECT
127
138
echo " DROP FUNCTION IF EXISTS f1;" | $BENDSQL_CLIENT_CONNECT
128
139
echo " DROP FUNCTION IF EXISTS f2;" | $BENDSQL_CLIENT_CONNECT
140
+ echo " drop function if exists a;" | $BENDSQL_CLIENT_CONNECT
141
+ echo " drop function if exists b;" | $BENDSQL_CLIENT_CONNECT
129
142
echo " drop table if exists default.t;" | $BENDSQL_CLIENT_CONNECT
130
143
echo " drop table if exists default.t2;" | $BENDSQL_CLIENT_CONNECT
131
144
echo " unset enable_experimental_rbac_check" | $BENDSQL_CLIENT_CONNECT
0 commit comments