Commit f413ac1a authored by Mike Hibler's avatar Mike Hibler
Browse files

Huh, our table_regex regex's for int types did not allow negative nums!

N.B. This fix is now update 599. What was update 599 is now 600.
parent f607e382
......@@ -1316,12 +1316,12 @@ REPLACE INTO table_regex VALUES ('default','html_text','text','regex','^[\\040-\
REPLACE INTO table_regex VALUES ('default','default','text','regex','^[\\040-\\073\\075\\077-\\176]*$',0,256,'Default regex if one is not defined for a table/slot. Allow any standard ascii character, but no binary data');
REPLACE INTO table_regex VALUES ('default','tinyint','int','regex','^[\\d]+$',-128,127,'Default regex for tiny int fields. Allow any standard ascii integer, but no binary data');
REPLACE INTO table_regex VALUES ('default','tinyint','int','regex','^[-+]?[\\d]+$',-128,127,'Default regex for tiny int fields. Allow any standard ascii integer, but no binary data');
REPLACE INTO table_regex VALUES ('default','boolean','int','regex','^(0|1)$',0,1,'Default regex for tiny int fields that are int booleans. Allow any 0 or 1');
REPLACE INTO table_regex VALUES ('default','tinyuint','int','regex','^[\\d]+$',0,255,'Default regex for tiny int fields. Allow any standard ascii integer, but no binary data');
REPLACE INTO table_regex VALUES ('default','int','int','regex','^[\\d]+$',-2147483648,2147483647,'Default regex for int fields. Allow any standard ascii integer, but no binary data');
REPLACE INTO table_regex VALUES ('default','int','int','regex','^[-+]?[\\d]+$',-2147483648,2147483647,'Default regex for int fields. Allow any standard ascii integer, but no binary data');
REPLACE INTO table_regex VALUES ('default','float','float','regex','^[+-]?\\ *(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$',-2147483648,2147483647,'Default regex for float fields. Allow any digits and the decimal point');
REPLACE INTO table_regex VALUES ('default','bigint','int','regex','^[\\d]+$',0,0,'Allow any ascii 64-bit integer');
REPLACE INTO table_regex VALUES ('default','bigint','int','regex','^[-+]?[\\d]+$',0,0,'Allow any ascii 64-bit integer');
REPLACE INTO table_regex VALUES ('default','tinytext_utf8','text','regex','^(?:[\\x20-\\x7E]|[\\xC2-\\xDF][\\x80-\\xBF]|\\xE0[\\xA0-\\xBF][\\x80-\\xBF]|[\\xE1-\\xEC\\xEE\\xEF][\\x80-\\xBF]{2}|\\xED[\\x80-\\x9F][\\x80-\\xBF])*$',0,256,'adopted from http://www.w3.org/International/questions/qa-forms-utf-8.en.php');
REPLACE INTO table_regex VALUES ('default','text_utf8','text','regex','^(?:[\\x20-\\x7E]|[\\xC2-\\xDF][\\x80-\\xBF]|\\xE0[\\xA0-\\xBF][\\x80-\\xBF]|[\\xE1-\\xEC\\xEE\\xEF][\\x80-\\xBF]{2}|\\xED[\\x80-\\x9F][\\x80-\\xBF])*$',0,65535,'adopted from http://www.w3.org/International/questions/qa-forms-utf-8.en.php');
REPLACE INTO table_regex VALUES ('default','fulltext_utf8','text','regex','^(?:[\\x09\\x0A\\x0D\\x20-\\x7E]|[\\xC2-\\xDF][\\x80-\\xBF]|\\xE0[\\xA0-\\xBF][\\x80-\\xBF]|[\\xE1-\\xEC\\xEE\\xEF][\\x80-\\xBF]{2}|\\xED[\\x80-\\x9F][\\x80-\\xBF])*$',0,65535,'adopted from http://www.w3.org/International/questions/qa-forms-utf-8.en.php');
......
#
# Add sitevariable that controls default distribution of root keypairs.
# Awesome, our table_regex checks for integer types never allowed
# negative numbers!
#
use strict;
use libdb;
......@@ -8,13 +9,16 @@ sub DoUpdate($$$)
{
my ($dbhandle, $dbname, $version) = @_;
DBQueryFatal("INSERT INTO `sitevariables` VALUES ".
"('general/root_keypair',NULL,'-1',".
"'Default distribution of per-experiment root keypairs ".
"(-1==disable root keypair mechanism, ".
"0==do not distribute to any nodes, ".
"1==distribute to all nodes).',0)")
if (!TBSiteVarExists("general/root_keypair"));
DBQueryFatal("UPDATE table_regex ".
"SET `check`='^[-+]?[\\\\d]+\$' ".
"WHERE table_name='default' AND column_name='tinyint'");
DBQueryFatal("UPDATE table_regex ".
"SET `check`='^[-+]?[\\\\d]+\$' ".
"WHERE table_name='default' AND column_name='int'");
DBQueryFatal("UPDATE table_regex ".
"SET `check`='^[-+]?[\\\\d]+\$' ".
"WHERE table_name='default' AND column_name='bigint'");
return 0;
}
......
#
# Add sitevariable that controls default distribution of root keypairs.
# Make virt_nodes fields except tinyint values rather than boolean.
#
use strict;
use libdb;
sub DoUpdate($$$)
{
my ($dbhandle, $dbname, $version) = @_;
DBQueryFatal("INSERT INTO `sitevariables` VALUES ".
"('general/root_keypair',NULL,'-1',".
"'Default distribution of per-experiment root keypairs ".
"(-1==disable root keypair mechanism, ".
"0==do not distribute to any nodes, ".
"1==distribute to all nodes).',0)")
if (!TBSiteVarExists("general/root_keypair"));
DBQueryFatal("UPDATE table_regex SET `check`='default:tinyint' ".
"WHERE table_name='virt_nodes' AND ".
" column_name='rootkey_private'");
DBQueryFatal("UPDATE table_regex SET `check`='default:tinyint' ".
"WHERE table_name='virt_nodes' AND ".
" column_name='rootkey_public'");
return 0;
}
1;
# 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