charles-001 / dolphie

Your single pane of glass for real-time analytics into MySQL/MariaDB & ProxySQL
https://pypi.org/project/dolphie/
GNU General Public License v3.0
589 stars 36 forks source link

Command 'u' not working for Percona Server 5.6 (Unknown system variable 'default_password_lifetime') #34

Closed pooh06 closed 1 year ago

pooh06 commented 1 year ago

MySQL version: Percona Server 5.6.15-rel63.0 Error: Unknown system variable 'default_password_lifetime'

Failed to execute query                                                                                                   

  /* dolphie */                                                                                                             
          SELECT                                                                                                            
              u.user AS user,                                                                                               
              total_connections,                                                                                            
              current_connections,                                                                                          
              CONVERT(SUM(sum_rows_affected), UNSIGNED) AS sum_rows_affected,                                               
              CONVERT(SUM(sum_rows_sent), UNSIGNED) AS sum_rows_sent,                                                       
              CONVERT(SUM(sum_rows_examined), UNSIGNED) AS sum_rows_examined,                                               
              CONVERT(SUM(sum_created_tmp_disk_tables), UNSIGNED) AS sum_created_tmp_disk_tables,                           
              CONVERT(SUM(sum_created_tmp_tables), UNSIGNED) AS sum_created_tmp_tables,                                     
              plugin,                                                                                                       
              CASE                                                                                                          
                  WHEN (password_lifetime IS NULL OR password_lifetime = 0) AND @@default_password_lifetime = 0 THEN "N/A"  
                  ELSE CONCAT(                                                                                              
                      CAST(IFNULL(password_lifetime, @@default_password_lifetime) as signed) +                              
                      CAST(DATEDIFF(password_last_changed, NOW()) as signed),                                               
                      " days"                                                                                               
                  )                                                                                                         
              END AS password_expires_in                                                                                    
          FROM                                                                                                              
              performance_schema.users u                                                                                    
              JOIN performance_schema.events_statements_summary_by_user_by_event_name ess ON u.user = ess.user              
              JOIN mysql.user mysql_user ON mysql_user.user = u.user                                                        
          WHERE                                                                                                             
              current_connections != 0                                                                                      
          GROUP BY                                                                                                          
              user                                                                                                          
          ORDER BY                                                                                                          
              current_connections DESC                                                                                      

  Unknown system variable 'default_password_lifetime'    
charles-001 commented 1 year ago

Hi @pooh06 - I've just pushed a fix for this. It will go into the next release at some point. Thank you for the bug report!