diff --git a/lib/WebGUI/Asset/Wobject/Thingy.pm b/lib/WebGUI/Asset/Wobject/Thingy.pm index 0ed898603..845470be7 100644 --- a/lib/WebGUI/Asset/Wobject/Thingy.pm +++ b/lib/WebGUI/Asset/Wobject/Thingy.pm @@ -130,13 +130,13 @@ sub addThing { } $db->write("create table ".$db->dbh->quote_identifier("Thingy_".$newThingId)."( - thingDataId varchar(22) binary not null, + thingDataId CHAR(22) binary not null, dateCreated int not null, - createdById varchar(22) not null, - updatedById varchar(22) not null, - updatedByName varchar(255) not null, + createdById CHAR(22) not null, + updatedById CHAR(22) not null, + updatedByName CHAR(255) not null, lastUpdated int not null, - ipAddress varchar(255), + ipAddress CHAR(255), primary key (thingDataId) ) ENGINE=MyISAM DEFAULT CHARSET=utf8"); @@ -591,7 +591,7 @@ sub _getDbDataType { my ($dbDataType, $formClass); if ($fieldType =~ m/^otherThing/x){ - $dbDataType = "varchar(22)"; + $dbDataType = "CHAR(22)"; } else{ $formClass = 'WebGUI::Form::' . ucfirst $fieldType; diff --git a/lib/WebGUI/AssetAspect/Installable.pm b/lib/WebGUI/AssetAspect/Installable.pm index d1c105102..e51b08f77 100644 --- a/lib/WebGUI/AssetAspect/Installable.pm +++ b/lib/WebGUI/AssetAspect/Installable.pm @@ -64,7 +64,7 @@ sub install { my $sql = q{CREATE TABLE `} . $installDef->{tableName} . q{` ( } - . q{`assetId` VARCHAR(22) BINARY NOT NULL, } + . q{`assetId` CHAR(22) BINARY NOT NULL, } . q{`revisionDate` BIGINT NOT NULL, }; for my $column ( keys %{ $installDef->{properties} } ) { my $control = WebGUI::Form::DynamicField->new( $session, %{ $installDef->{properties}->{$column} } ); diff --git a/lib/WebGUI/Crud.pm b/lib/WebGUI/Crud.pm index 0f548065f..70e2c64fa 100644 --- a/lib/WebGUI/Crud.pm +++ b/lib/WebGUI/Crud.pm @@ -209,7 +209,7 @@ sub crud_createTable { my $tableName = $class->crud_getTableName($session); $class->crud_dropTable($session); $db->write('create table '.$dbh->quote_identifier($tableName).' ( - '.$dbh->quote_identifier($class->crud_getTableKey($session)).' varchar(22) binary not null primary key, + '.$dbh->quote_identifier($class->crud_getTableKey($session)).' CHAR(22) binary not null primary key, sequenceNumber int not null default 1, dateCreated datetime, lastUpdated datetime diff --git a/lib/WebGUI/Form/Attachments.pm b/lib/WebGUI/Form/Attachments.pm index aec722f87..c92c25bcc 100644 --- a/lib/WebGUI/Form/Attachments.pm +++ b/lib/WebGUI/Form/Attachments.pm @@ -102,12 +102,12 @@ sub definition { =head2 getDatabaseFieldType ( ) -Returns "VARCHAR(22) BINARY". +Returns "CHAR(22) BINARY". =cut sub getDatabaseFieldType { - return "VARCHAR(22) BINARY"; + return "CHAR(22) BINARY"; } #------------------------------------------------------------------- diff --git a/lib/WebGUI/Form/Color.pm b/lib/WebGUI/Form/Color.pm index 482369dac..632ffa7d7 100644 --- a/lib/WebGUI/Form/Color.pm +++ b/lib/WebGUI/Form/Color.pm @@ -40,12 +40,12 @@ The following methods are specifically available from this class. Check the supe =head2 getDatabaseFieldType ( ) -Returns "VARCHAR(7)". +Returns "CHAR(7)". =cut sub getDatabaseFieldType { - return "VARCHAR(7)"; + return "CHAR(7)"; } #------------------------------------------------------------------- diff --git a/lib/WebGUI/Form/Control.pm b/lib/WebGUI/Form/Control.pm index d9de1fdce..0d7560cf7 100644 --- a/lib/WebGUI/Form/Control.pm +++ b/lib/WebGUI/Form/Control.pm @@ -358,12 +358,12 @@ sub get { =head2 getDatabaseFieldType ( ) -A class method that tells you what database field type this form field should be stored in. Defaults to "VARCHAR(255)". +A class method that tells you what database field type this form field should be stored in. Defaults to "CHAR(255)". =cut sub getDatabaseFieldType { - return "VARCHAR(255)"; + return "CHAR(255)"; } diff --git a/lib/WebGUI/Form/File.pm b/lib/WebGUI/Form/File.pm index 5dc14984e..57bda66e2 100644 --- a/lib/WebGUI/Form/File.pm +++ b/lib/WebGUI/Form/File.pm @@ -92,12 +92,12 @@ sub definition { =head2 getDatabaseFieldType ( ) -Returns "VARCHAR(22) BINARY". +Returns "CHAR(22) BINARY". =cut sub getDatabaseFieldType { - return "VARCHAR(22) BINARY"; + return "CHAR(22) BINARY"; } #------------------------------------------------------------------- diff --git a/lib/WebGUI/Form/FilterContent.pm b/lib/WebGUI/Form/FilterContent.pm index 9996c3d53..c6ca1ad38 100644 --- a/lib/WebGUI/Form/FilterContent.pm +++ b/lib/WebGUI/Form/FilterContent.pm @@ -96,12 +96,12 @@ sub definition { =head2 getDatabaseFieldType ( ) -Returns "VARCHAR(16)". +Returns "CHAR(16)". =cut sub getDatabaseFieldType { - return "VARCHAR(16)"; + return "CHAR(16)"; } #------------------------------------------------------------------- diff --git a/lib/WebGUI/Form/SelectBox.pm b/lib/WebGUI/Form/SelectBox.pm index bd61989e7..6fe863969 100644 --- a/lib/WebGUI/Form/SelectBox.pm +++ b/lib/WebGUI/Form/SelectBox.pm @@ -71,12 +71,12 @@ sub definition { =head2 getDatabaseFieldType ( ) -Returns "VARCHAR(255)". +Returns "CHAR(255)". =cut sub getDatabaseFieldType { - return "VARCHAR(255)"; + return "CHAR(255)"; } #------------------------------------------------------------------- diff --git a/lib/WebGUI/Form/User.pm b/lib/WebGUI/Form/User.pm index ce09d7cd3..45009140c 100644 --- a/lib/WebGUI/Form/User.pm +++ b/lib/WebGUI/Form/User.pm @@ -86,12 +86,12 @@ sub definition { =head2 getDatabaseFieldType ( ) -Returns "VARCHAR(22) BINARY". +Returns "CHAR(22) BINARY". =cut sub getDatabaseFieldType { - return "VARCHAR(22) BINARY"; + return "CHAR(22) BINARY"; } #------------------------------------------------------------------- diff --git a/lib/WebGUI/Form/Vendor.pm b/lib/WebGUI/Form/Vendor.pm index 2900cfd72..17f46f39e 100644 --- a/lib/WebGUI/Form/Vendor.pm +++ b/lib/WebGUI/Form/Vendor.pm @@ -88,12 +88,12 @@ sub definition { =head2 getDatabaseFieldType ( ) -Returns "VARCHAR(22) BINARY". +Returns "CHAR(22) BINARY". =cut sub getDatabaseFieldType { - return "VARCHAR(22) BINARY"; + return "CHAR(22) BINARY"; } #------------------------------------------------------------------- diff --git a/lib/WebGUI/Macro/User.pm b/lib/WebGUI/Macro/User.pm index 7d1293bf8..f8762e361 100644 --- a/lib/WebGUI/Macro/User.pm +++ b/lib/WebGUI/Macro/User.pm @@ -53,4 +53,4 @@ sub process { return $user->profileField($field); } -1; \ No newline at end of file +1; diff --git a/lib/WebGUI/Operation/Inbox.pm b/lib/WebGUI/Operation/Inbox.pm index b33855295..f39ed45d7 100644 --- a/lib/WebGUI/Operation/Inbox.pm +++ b/lib/WebGUI/Operation/Inbox.pm @@ -154,4 +154,4 @@ sub www_viewInboxMessage { return $instance->displayContent($instance->callMethod("viewMessage")); } -1; \ No newline at end of file +1; diff --git a/t/Crud.t b/t/Crud.t index 396b470eb..4b697bd17 100644 --- a/t/Crud.t +++ b/t/Crud.t @@ -37,7 +37,7 @@ WebGUI::Crud->crud_createTable($session); my $sth = $session->db->read("describe unnamed_crud_table"); my ($col, $type) = $sth->array(); is($col, 'id', "structure: id name"); -is($type, 'varchar(22)', "structure: id type"); +is($type, 'char(22)', "structure: id type"); ($col, $type) = $sth->array(); is($col, 'sequenceNumber', "structure: sequenceNumber name"); is($type, 'int(11)', "structure: sequenceNumber type"); diff --git a/t/Group.t b/t/Group.t index 3213c3d28..34065020c 100644 --- a/t/Group.t +++ b/t/Group.t @@ -384,7 +384,7 @@ cmp_bag($everyUsers, $everyoneGroup->getUsers(), 'addUsers will not add a user t ##Database based user membership in groups $session->db->dbh->do('DROP TABLE IF EXISTS myUserTable'); -$session->db->dbh->do(q!CREATE TABLE myUserTable (userId varchar(22) binary NOT NULL default '', PRIMARY KEY(userId)) TYPE=InnoDB!); +$session->db->dbh->do(q!CREATE TABLE myUserTable (userId CHAR(22) binary NOT NULL default '', PRIMARY KEY(userId)) TYPE=InnoDB!); my $sth = $session->db->prepare('INSERT INTO myUserTable VALUES(?)'); foreach my $mob (@mob) { diff --git a/t/Macro/GroupText.t b/t/Macro/GroupText.t index 32f2268cc..ea78456e0 100644 --- a/t/Macro/GroupText.t +++ b/t/Macro/GroupText.t @@ -56,7 +56,7 @@ is($output, 'Group Not a Group was not found', 'Non-existant group returns an er ##Create a small database $session->db->dbh->do('DROP TABLE IF EXISTS myUserTable'); -$session->db->dbh->do(q!CREATE TABLE myUserTable (userId varchar(22) binary NOT NULL default '', PRIMARY KEY(userId)) TYPE=InnoDB!); +$session->db->dbh->do(q!CREATE TABLE myUserTable (userId CHAR(22) binary NOT NULL default '', PRIMARY KEY(userId)) TYPE=InnoDB!); ##Create a bunch of users and put them in the table. diff --git a/t/SQL.t b/t/SQL.t index 3323cf5a4..c6733ee82 100644 --- a/t/SQL.t +++ b/t/SQL.t @@ -164,7 +164,7 @@ SKIP: { skip("No InnoDB tables in this MySQL. Skipping all transaction related tests.",7) if (lc $mysqlVariables{have_innodb} ne 'yes'); $session->db->dbh->do('DROP TABLE IF EXISTS testTable'); - $session->db->dbh->do('CREATE TABLE testTable (myIndex int(8) NOT NULL default 0, message varchar(64), PRIMARY KEY(myIndex)) TYPE=InnoDB'); + $session->db->dbh->do('CREATE TABLE testTable (myIndex int(8) NOT NULL default 0, message CHAR(64), PRIMARY KEY(myIndex)) TYPE=InnoDB'); my $dbh2 = WebGUI::SQL->connect($session,$session->config->get("dsn"), $session->config->get("dbuser"), $session->config->get("dbpass")); my ($sth, $sth2, $rc); @@ -215,7 +215,7 @@ SKIP: { } -$session->db->dbh->do('CREATE TABLE testTable (myIndex int(8) NOT NULL default 0, message varchar(64), myKey varchar(32), PRIMARY KEY(myIndex))'); +$session->db->dbh->do('CREATE TABLE testTable (myIndex int(8) NOT NULL default 0, message CHAR(64), myKey varchar(32), PRIMARY KEY(myIndex))'); my @tableData = ( [ 0, 'zero', 'A' ],