@@ -617,10 +617,17 @@ public function testExecuteQueryAndSendQueryResponse(): void
617617 public function testGetDetailedProfilingStatsWithoutData (): void
618618 {
619619 $ method = new ReflectionMethod ($ this ->sql , 'getDetailedProfilingStats ' );
620- $ this ->assertSame (
621- ['total_time ' => 0 , 'states ' => [], 'chart ' => [], 'profile ' => []],
622- $ method ->invoke ($ this ->sql , []),
623- );
620+ $ this ->assertSame ([], $ method ->invoke ($ this ->sql , []));
621+ }
622+
623+ public function testGetDetailedProfilingStatsWithZeroTotalTime (): void
624+ {
625+ $ method = new ReflectionMethod ($ this ->sql , 'getDetailedProfilingStats ' );
626+ $ profiling = [
627+ ['Status ' => 'Starting ' , 'Duration ' => '0 ' ],
628+ ['Status ' => 'checking permissions ' , 'Duration ' => '0 ' ],
629+ ];
630+ $ this ->assertSame ([], $ method ->invoke ($ this ->sql , $ profiling ));
624631 }
625632
626633 public function testGetDetailedProfilingStatsWithData (): void
@@ -659,50 +666,50 @@ public function testGetDetailedProfilingStatsWithData(): void
659666 $ expected = [
660667 'total_time ' => 0.000299 ,
661668 'states ' => [
662- 'Starting ' => ['total_time ' => ' 0.000017 ' , 'calls ' => 1 ],
663- 'Checking Permissions ' => ['total_time ' => ' 0.000003 ' , 'calls ' => 1 ],
669+ 'Starting ' => ['total_time ' => 0.000017 , 'calls ' => 1 ],
670+ 'Checking Permissions ' => ['total_time ' => 0.000003 , 'calls ' => 1 ],
664671 'Opening Tables ' => ['total_time ' => 0.00016 , 'calls ' => 2 ],
665- 'After Opening Tables ' => ['total_time ' => 6.0E-6 , 'calls ' => 2 ],
666- 'System Lock ' => ['total_time ' => 4.0E-6 , 'calls ' => 2 ],
667- 'Table Lock ' => ['total_time ' => 1.5E-5 , 'calls ' => 2 ],
668- 'Unlocking Tables ' => ['total_time ' => 4.0E-6 , 'calls ' => 2 ],
669- 'Closing Tables ' => ['total_time ' => 9.0E-6 , 'calls ' => 3 ],
670- 'Init ' => ['total_time ' => ' 0.000007 ' , 'calls ' => 1 ],
671- 'Optimizing ' => ['total_time ' => ' 0.000004 ' , 'calls ' => 1 ],
672- 'Statistics ' => ['total_time ' => ' 0.000006 ' , 'calls ' => 1 ],
673- 'Preparing ' => ['total_time ' => ' 0.000006 ' , 'calls ' => 1 ],
674- 'Executing ' => ['total_time ' => ' 0.000002 ' , 'calls ' => 1 ],
675- 'Sending Data ' => ['total_time ' => ' 0.000029 ' , 'calls ' => 1 ],
676- 'End Of Update Loop ' => ['total_time ' => ' 0.000003 ' , 'calls ' => 1 ],
677- 'Query End ' => ['total_time ' => ' 0.000002 ' , 'calls ' => 1 ],
678- 'Commit ' => ['total_time ' => ' 0.000002 ' , 'calls ' => 1 ],
679- 'Starting Cleanup ' => ['total_time ' => ' 0.000002 ' , 'calls ' => 1 ],
680- 'Freeing Items ' => ['total_time ' => ' 0.000002 ' , 'calls ' => 1 ],
681- 'Updating Status ' => ['total_time ' => ' 0.000007 ' , 'calls ' => 1 ],
682- 'Reset For Next Command ' => ['total_time ' => ' 0.000009 ' , 'calls ' => 1 ],
672+ 'After Opening Tables ' => ['total_time ' => 0.000006 , 'calls ' => 2 ],
673+ 'System Lock ' => ['total_time ' => 0.000004 , 'calls ' => 2 ],
674+ 'Table Lock ' => ['total_time ' => 0.000015 , 'calls ' => 2 ],
675+ 'Unlocking Tables ' => ['total_time ' => 0.000004 , 'calls ' => 2 ],
676+ 'Closing Tables ' => ['total_time ' => 0.000009 , 'calls ' => 3 ],
677+ 'Init ' => ['total_time ' => 0.000007 , 'calls ' => 1 ],
678+ 'Optimizing ' => ['total_time ' => 0.000004 , 'calls ' => 1 ],
679+ 'Statistics ' => ['total_time ' => 0.000006 , 'calls ' => 1 ],
680+ 'Preparing ' => ['total_time ' => 0.000006 , 'calls ' => 1 ],
681+ 'Executing ' => ['total_time ' => 0.000002 , 'calls ' => 1 ],
682+ 'Sending Data ' => ['total_time ' => 0.000029 , 'calls ' => 1 ],
683+ 'End Of Update Loop ' => ['total_time ' => 0.000003 , 'calls ' => 1 ],
684+ 'Query End ' => ['total_time ' => 0.000002 , 'calls ' => 1 ],
685+ 'Commit ' => ['total_time ' => 0.000002 , 'calls ' => 1 ],
686+ 'Starting Cleanup ' => ['total_time ' => 0.000002 , 'calls ' => 1 ],
687+ 'Freeing Items ' => ['total_time ' => 0.000002 , 'calls ' => 1 ],
688+ 'Updating Status ' => ['total_time ' => 0.000007 , 'calls ' => 1 ],
689+ 'Reset For Next Command ' => ['total_time ' => 0.000009 , 'calls ' => 1 ],
683690 ],
684691 'chart ' => [
685- 'Starting ' => ' 0.000017 ' ,
686- 'Checking Permissions ' => ' 0.000003 ' ,
692+ 'Starting ' => 0.000017 ,
693+ 'Checking Permissions ' => 0.000003 ,
687694 'Opening Tables ' => 0.00016 ,
688- 'After Opening Tables ' => 6.0E-6 ,
689- 'System Lock ' => 4.0E-6 ,
690- 'Table Lock ' => 1.5E-5 ,
691- 'Unlocking Tables ' => 4.0E-6 ,
692- 'Closing Tables ' => 9.0E-6 ,
693- 'Init ' => ' 0.000007 ' ,
694- 'Optimizing ' => ' 0.000004 ' ,
695- 'Statistics ' => ' 0.000006 ' ,
696- 'Preparing ' => ' 0.000006 ' ,
697- 'Executing ' => ' 0.000002 ' ,
698- 'Sending Data ' => ' 0.000029 ' ,
699- 'End Of Update Loop ' => ' 0.000003 ' ,
700- 'Query End ' => ' 0.000002 ' ,
701- 'Commit ' => ' 0.000002 ' ,
702- 'Starting Cleanup ' => ' 0.000002 ' ,
703- 'Freeing Items ' => ' 0.000002 ' ,
704- 'Updating Status ' => ' 0.000007 ' ,
705- 'Reset For Next Command ' => ' 0.000009 ' ,
695+ 'After Opening Tables ' => 0.000006 ,
696+ 'System Lock ' => 0.000004 ,
697+ 'Table Lock ' => 0.000015 ,
698+ 'Unlocking Tables ' => 0.000004 ,
699+ 'Closing Tables ' => 0.000009 ,
700+ 'Init ' => 0.000007 ,
701+ 'Optimizing ' => 0.000004 ,
702+ 'Statistics ' => 0.000006 ,
703+ 'Preparing ' => 0.000006 ,
704+ 'Executing ' => 0.000002 ,
705+ 'Sending Data ' => 0.000029 ,
706+ 'End Of Update Loop ' => 0.000003 ,
707+ 'Query End ' => 0.000002 ,
708+ 'Commit ' => 0.000002 ,
709+ 'Starting Cleanup ' => 0.000002 ,
710+ 'Freeing Items ' => 0.000002 ,
711+ 'Updating Status ' => 0.000007 ,
712+ 'Reset For Next Command ' => 0.000009 ,
706713 ],
707714 'profile ' => [
708715 ['status ' => 'Starting ' , 'duration ' => '17 µ ' , 'duration_raw ' => '0.000017 ' ],
0 commit comments