@@ -3119,42 +3119,44 @@ impl<'a> TypeChecker<'a> {
31193119 Ok ( Box :: new ( ( subquery_expr. into ( ) , data_type) ) )
31203120 }
31213121
3122- pub fn all_sugar_functions ( ) -> & ' static [ & ' static str ] {
3123- & [
3124- "database" ,
3125- "currentdatabase" ,
3126- "current_database" ,
3127- "version" ,
3128- "user" ,
3129- "currentuser" ,
3130- "current_user" ,
3131- "current_role" ,
3132- "connection_id" ,
3133- "timezone" ,
3134- "nullif" ,
3135- "ifnull" ,
3136- "nvl" ,
3137- "nvl2" ,
3138- "is_null" ,
3139- "is_error" ,
3140- "error_or" ,
3141- "coalesce" ,
3142- "last_query_id" ,
3143- "array_sort" ,
3144- "array_aggregate" ,
3145- "to_variant" ,
3146- "try_to_variant" ,
3147- "greatest" ,
3148- "least" ,
3149- "stream_has_data" ,
3150- "getvariable" ,
3151- ]
3122+ pub fn all_sugar_functions ( ) -> & ' static [ Ascii < & ' static str > ] {
3123+ static FUNCTIONS : & [ Ascii < & ' static str > ] = & [
3124+ Ascii :: new ( "database" ) ,
3125+ Ascii :: new ( "currentdatabase" ) ,
3126+ Ascii :: new ( "current_database" ) ,
3127+ Ascii :: new ( "version" ) ,
3128+ Ascii :: new ( "user" ) ,
3129+ Ascii :: new ( "currentuser" ) ,
3130+ Ascii :: new ( "current_user" ) ,
3131+ Ascii :: new ( "current_role" ) ,
3132+ Ascii :: new ( "connection_id" ) ,
3133+ Ascii :: new ( "timezone" ) ,
3134+ Ascii :: new ( "nullif" ) ,
3135+ Ascii :: new ( "ifnull" ) ,
3136+ Ascii :: new ( "nvl" ) ,
3137+ Ascii :: new ( "nvl2" ) ,
3138+ Ascii :: new ( "is_null" ) ,
3139+ Ascii :: new ( "is_error" ) ,
3140+ Ascii :: new ( "error_or" ) ,
3141+ Ascii :: new ( "coalesce" ) ,
3142+ Ascii :: new ( "last_query_id" ) ,
3143+ Ascii :: new ( "array_sort" ) ,
3144+ Ascii :: new ( "array_aggregate" ) ,
3145+ Ascii :: new ( "to_variant" ) ,
3146+ Ascii :: new ( "try_to_variant" ) ,
3147+ Ascii :: new ( "greatest" ) ,
3148+ Ascii :: new ( "least" ) ,
3149+ Ascii :: new ( "stream_has_data" ) ,
3150+ Ascii :: new ( "getvariable" ) ,
3151+ ] ;
3152+ FUNCTIONS
31523153 }
31533154
31543155 pub fn is_sugar_function ( name : & str ) -> bool {
3155- Self :: all_sugar_functions ( )
3156+ let name = Ascii :: new ( name) ;
3157+ all_sugar_functions ( )
31563158 . iter ( )
3157- . any ( |func| func. eq_ignore_ascii_case ( name) )
3159+ . any ( |func| func. eq ( & name) )
31583160 }
31593161
31603162 fn try_rewrite_sugar_function (
0 commit comments