b5a09059aadfa4868406131645655f4807460198
jcasper
  Mon Mar 24 22:01:37 2025 -0700
If .as variables can start with an underscore, then we need to accept them as valid
variable names when defining autosql arrays, refs #31812

diff --git src/lib/asParse.c src/lib/asParse.c
index 6e9f3f757b9..5086b95107a 100644
--- src/lib/asParse.c
+++ src/lib/asParse.c
@@ -190,31 +190,33 @@
 
 static void asParseColArraySpec(struct tokenizer *tkz, struct asObject *obj,
                                 struct asColumn *col)
 /* parse the array length specification for a column */
 {
 if (col->lowType->type == t_simple)
     col->isArray = TRUE;
 else
     col->isList = TRUE;
 tokenizerMustHaveNext(tkz);
 if (isdigit(tkz->string[0]))
     {
     col->fixedSize = atoi(tkz->string);
     tokenizerMustHaveNext(tkz);
     }
-else if (isalpha(tkz->string[0]))
+else if (isalpha(tkz->string[0]) ||
+        (strlen(tkz->string)>1 && tkz->string[0] == '_' && isalpha(tkz->string[1])))
+        // variable names may start with an underscore now
     {
 #ifdef OLD
     if (obj->isSimple)
         tokenizerErrAbort(tkz, "simple objects can't include variable length arrays\n");
 #endif /* OLD */
     col->linkedSizeName = cloneString(tkz->string);
     col->linkedSize = mustFindColumn(obj, col->linkedSizeName);
     col->linkedSize->isSizeLink = TRUE;
     tokenizerMustHaveNext(tkz);
     }
 else
     tokenizerErrAbort(tkz, "must have column name or integer inside []'s\n");
 tokenizerMustMatch(tkz, "]");
 }