Doctrine DBAL
  1. Doctrine DBAL
  2. DBAL-101

Undefined index "length" in SqliteSchemaManager

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1
    • Fix Version/s: 2.0.4
    • Component/s: None
    • Labels:
      None

      Description

      If not giving length for numeric columns when using SQLite, I got an undefined index error around line 155 in SqliteSchemaManager. I fixed it with this:

                   case 'numeric':
      -                list($precision, $scale) = array_map('trim', explode(', ', $tableColumn['length']));
      +                if (array_key_exists('length', $tableColumn)) {
      +                    list($precision, $scale) = array_map('trim', explode(', ', $tableColumn['length']));
      +                } else {
      +                    $precision = $scale = null;
      +                }
                       $length = null;
                       break;
       

      Git patch attached.

        Activity

        Hide
        Benjamin Eberlei added a comment -

        Fixed

        Show
        Benjamin Eberlei added a comment - Fixed

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Karsten Dambekalns
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: