Commit 5637fac4 authored by Mike Hibler's avatar Mike Hibler

Ensure EID does not end with a '-'. From Keith Sklower:

  "Experiment names get embedded as a DNS name (as we all know)
   and labels which end with a hyphen are illegal."
parent 508bd9e5
......@@ -737,7 +737,7 @@ REPLACE INTO table_regex VALUES ('eventlist','arguments','text','redirect','defa
REPLACE INTO table_regex VALUES ('eventlist','atstring','text','redirect','default:html_text',0,1024,NULL);
REPLACE INTO table_regex VALUES ('eventlist','triggertype','int','redirect','default:tinyint',0,0,NULL);
REPLACE INTO table_regex VALUES ('experiments','eid','text','regex','^[a-zA-Z0-9][-a-zA-Z0-9]+$',2,19,'Must ensure not too long for the database. PID is 12, and the max is 32, so the user is not allowed to specify an EID more than 19, since other parts of the system may concatenate them together with a hyphen');
REPLACE INTO table_regex VALUES ('experiments','eid','text','regex','^[a-zA-Z0-9][-a-zA-Z0-9]*[a-zA-Z0-9]$',2,19,'Must ensure not too long for the database. PID is 12, and the max is 32, so the user is not allowed to specify an EID more than 19, since other parts of the system may concatenate them together with a hyphen');
REPLACE INTO table_regex VALUES ('experiments','eid_idx','text','regex','^[\\d]+$',1,12,NULL);
REPLACE INTO table_regex VALUES ('experiments','multiplex_factor','int','redirect','default:tinyint',0,0,NULL);
REPLACE INTO table_regex VALUES ('experiments','forcelinkdelays','int','redirect','default:boolean',0,0,NULL);
......
#
# Ensure EID does not end with a '-'. From Keith Sklower:
# "Experiment names get embedded as a DNS name (as we all know)
# and labels which end with a hyphen are illegal."
#
use strict;
use libdb;
sub DoUpdate($$$)
{
my ($dbhandle, $dbname, $version) = @_;
DBQueryFatal("REPLACE INTO table_regex VALUES ".
" ('experiments','eid','text','regex',".
" '^[a-zA-Z0-9][-a-zA-Z0-9]*[a-zA-Z0-9]\$',2,19,".
"'Must ensure not too long for the database. ".
"PID is 12, and the max is 32, so the user is not allowed ".
"to specify an EID more than 19, since other parts of the ".
"system may concatenate them together with a hyphen')");
return 0;
}
# Local Variables:
# mode:perl
# End:
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment