• unknown's avatar
    Bug#21014: Segmentation fault of mysqldump on view · f27e9254
    unknown authored
    mysqldump did not select the correct database before trying to dump
    views from it. this resulted in an empty result set, which in turn
    startled mysql-dump into a core-dump.  this only happened for views,
    not for tables, and was only visible with multiple databases that
    weren't by sheer luck in the order mysqldump required, anyway. this
    fixes by selecting the correct database before dumping views; it also
    catches the empty set-condition if it should occur for other reasons.
    
    
    client/mysqldump.c:
      Bug#21014: Segmentation fault of mysqldump on view
      
      failsafe: if "select ... from information_schema.views" returns an
      empty set, don't deref NULL; throw an error instead.
      
      fix: select the correct database not only before dumping tables, but
      before dumping views, as well.
    mysql-test/r/mysqldump.result:
      Bug#21014: Segmentation fault of mysqldump on view
      
      show that mysqldump selects the correct database before trying to dump
      views from it.
    mysql-test/t/mysqldump.test:
      Bug#21014: Segmentation fault of mysqldump on view
      
      show that mysqldump selects the correct database before trying to dump
      views from it.
    f27e9254
mysqldump.result 125 KB