Index: pathauto.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/pathauto/pathauto.inc,v
retrieving revision 1.45.2.8
diff -u -p -r1.45.2.8 pathauto.inc
--- pathauto.inc	10 Feb 2010 22:09:18 -0000	1.45.2.8
+++ pathauto.inc	17 Feb 2010 23:57:01 -0000
@@ -353,7 +353,7 @@ function pathauto_create_alias($module, 
   $alias = pathauto_clean_alias($alias);
 
   // Enforce the maximum length.
-  $maxlength = min(variable_get('pathauto_max_length', 100), 128);
+  $maxlength = min(variable_get('pathauto_max_length', 100), _pathauto_get_schema_alias_maxlength());
   $alias = drupal_substr($alias, 0, $maxlength);
 
   // If the alias already exists, generate a new, hopefully unique, variant
@@ -568,3 +568,18 @@ function pathauto_punctuation_chars() {
 
   return $punctuation;
 }
+
+/**
+ * Fetch the maximum length of the {url_alias}.dst field from the schema.
+ *
+ * @return
+ *   An integer of the maximum url alias length allowed by the database.
+ */
+function _pathauto_get_schema_alias_maxlength() {
+  static $maxlength;
+  if (!isset($maxlength)) {
+    $schema = drupal_get_schema('url_alias');
+    $maxlength = $schema['fields']['dst']['length'];
+  }
+  return $maxlength;
+}
Index: pathauto.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/pathauto/pathauto.module,v
retrieving revision 1.118.2.12
diff -u -p -r1.118.2.12 pathauto.module
--- pathauto.module	17 Feb 2010 20:40:36 -0000	1.118.2.12
+++ pathauto.module	17 Feb 2010 23:57:01 -0000
@@ -27,8 +27,8 @@ function pathauto_help($path, $arg) {
       $output = t('<p>Provides a mechanism for modules to automatically generate aliases for the content they manage.</p>
                   <h2>Settings</h2>
                   <p>The <strong>Maximum Alias Length</strong> and <strong>Maximum component length</strong> values
-                  default to 100 and have a limit of 128 from pathauto. This length is limited by the length of the dst
-                  column of the url_alias database table. The default database schema for this column is 128. If you
+                  default to 100 and have a limit of @max from pathauto. This length is limited by the length of the dst
+                  column of the url_alias database table. The default database schema for this column is @max. If you
                   set a length that is equal to that of the one set in the dst column it will cause problems in situations
                   where the system needs to append additional words to the aliased URL. For example... URLs generated
                   for feeds will have "/feed" added to the end. You should enter a value that is the length of the dst
@@ -37,7 +37,7 @@ function pathauto_help($path, $arg) {
                   on your Pathauto settings. The recommended and default value is 100.</p>
                   <p><strong>Raw Tokens</strong> In Pathauto it is appropriate to use the -raw form of tokens. Paths are
                   sent through a filtering system which ensures that raw user content is filtered. Failure to use -raw
-                  tokens can cause problems with the Pathauto punctuation filtering system.</p>');
+                  tokens can cause problems with the Pathauto punctuation filtering system.</p>', array('@max' => _pathauto_get_schema_alias_maxlength()));
       return $output;
   }
 }
