Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Foellmann <foellmann@foe-services.de>2014-07-28 14:13:10 +0400
committerChristian Foellmann <foellmann@foe-services.de>2014-07-28 14:13:10 +0400
commit276394119dfbe117acd411a3862de597ba35a2ad (patch)
tree3dc394a15f459d6324e3452e15e9446e47fe3bd0 /libraries/Types.class.php
parentc8c2e72886de1b71f5abcaa295075da9666096b5 (diff)
UPDATE phpmyadmin 4.2.6 multilanguage
Diffstat (limited to 'libraries/Types.class.php')
-rw-r--r--libraries/Types.class.php93
1 files changed, 93 insertions, 0 deletions
diff --git a/libraries/Types.class.php b/libraries/Types.class.php
index 455c27dc90..3d8ed825fb 100644
--- a/libraries/Types.class.php
+++ b/libraries/Types.class.php
@@ -272,6 +272,29 @@ class PMA_Types
'DATE',
);
}
+
+ /**
+ * Returns an array of integer types
+ *
+ * @return string[] integer types
+ */
+ public function getIntegerTypes()
+ {
+ return array();
+ }
+
+ /**
+ * Returns the min and max values of a given integer type
+ *
+ * @param string $type integer type
+ * @param boolean $signed whether signed
+ *
+ * @return string[] min and max values
+ */
+ public function getIntegerRange($type, $signed = true)
+ {
+ return array('', '');
+ }
}
/**
@@ -452,6 +475,7 @@ class PMA_Types_MySQL extends PMA_Types
switch ($class) {
case 'CHAR':
return array(
+ 'AES_DECRYPT',
'AES_ENCRYPT',
'BIN',
'CHAR',
@@ -685,6 +709,48 @@ class PMA_Types_MySQL extends PMA_Types
return $ret;
}
+
+ /**
+ * Returns an array of integer types
+ *
+ * @return string[] integer types
+ */
+ public function getIntegerTypes()
+ {
+ return array('tinyint', 'smallint', 'mediumint', 'int', 'bigint');
+ }
+
+ /**
+ * Returns the min and max values of a given integer type
+ *
+ * @param string $type integer type
+ * @param boolean $signed whether signed
+ *
+ * @return string[] min and max values
+ */
+ public function getIntegerRange($type, $signed = true)
+ {
+ static $min_max_data = array(
+ 'unsigned' => array(
+ 'tinyint' => array('0', '255'),
+ 'smallint' => array('0', '65535'),
+ 'mediumint' => array('0', '16777215'),
+ 'int' => array('0', '4294967295'),
+ 'bigint' => array('0', '18446744073709551615')
+ ),
+ 'signed' => array(
+ 'tinyint' => array('-128', '127'),
+ 'smallint' => array('-32768', '32767'),
+ 'mediumint' => array('-8388608', '8388607'),
+ 'int' => array('-2147483648', '2147483647'),
+ 'bigint' => array('-9223372036854775808', '9223372036854775807')
+ )
+ );
+ $relevantArray = $signed
+ ? $min_max_data['signed']
+ : $min_max_data['unsigned'];
+ return isset($relevantArray[$type]) ? $relevantArray[$type] : array('', '');
+ }
}
/**
@@ -983,4 +1049,31 @@ class PMA_Types_Drizzle extends PMA_Types
return $ret;
}
+
+ /**
+ * Returns an array of integer types
+ *
+ * @return string[] integer types
+ */
+ public function getIntegerTypes()
+ {
+ return array('integer', 'bigint');
+ }
+
+ /**
+ * Returns the min and max values of a given integer type
+ *
+ * @param string $type integer type
+ * @param boolean $signed whether signed (ignored for Drizzle)
+ *
+ * @return string[] min and max values
+ */
+ public function getIntegerRange($type, $signed = true)
+ {
+ static $min_max_data = array(
+ 'integer' => array('-2147483648', '2147483647'),
+ 'bigint' => array('-9223372036854775808', '9223372036854775807')
+ );
+ return isset($min_max_data[$type]) ? $min_max_data[$type] : array('', '');
+ }
}