[MDEV-13002] mysqltest regex replace results in incorrect result Created: 2017-06-06  Updated: 2017-06-29  Resolved: 2017-06-19

Status: Closed
Project: MariaDB Server
Component/s: Scripts & Clients, Tests
Affects Version/s: 5.5, 10.0, 10.1, 10.2.6, 10.2
Fix Version/s: 10.1.25, 5.5.57, 10.0.32, 10.2.7

Type: Bug Priority: Major
Reporter: Daniel Black Assignee: Sergei Golubchik
Resolution: Fixed Votes: 0
Labels: None


 Description   

From https://travis-ci.org/MariaDB/server/jobs/238967452

As seen with the : plugins.server_audit and plugins.thread_pool_server_audit tests

Setting a large hostname like travis (testing-docker-99f46c25-f6c4-4465-bc49-ee78d188e37c) is sufficient to trigger test. A smaller test hostname of
testing-docker-99f46c25 passes.

The regexs are right using [^,]* as the host match which should match the hostname. Though it escapes for ',' I don't think escaping is needed (and it doesn't affect result removing escapes).

related to c91ecf9e9bebf3cf2dafbd3193de4df94be09870 ?

Testable locally by changing hostname to a name above with hostname command.

];mtr: spent 0:01:23 on 237 tests. 0:02:04 (356 tests) leftplugins.server_audit                     w4 [ fail ]
 
        Test ended at 2017-06-03 01:45:44
 
CURRENT_TEST: plugins.server_audit
 
--- /home/travis/build/MariaDB/server/mysql-test/suite/plugins/r/server_audit.result	2017-06-03 01:12:33.602546287 +0000
 
+++ /home/travis/build/MariaDB/server/mysql-test/suite/plugins/r/server_audit.reject	2017-06-03 01:45:43.814546287 +0000
 
@@ -368,7 +368,7 @@
 
 TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_file_path=\'  \'',0
 
 TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'show status like \'server_audit_current_log\'',0
 
 TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_file_path=\'nonexisting_dir/\'',0
 
-TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_file_path=\'nonexisting_dir/\'',0
 
+20170603 01:45:43,testing-docker-de343aff-a28e-4fe6-a1e4-4b97f4f3d0c3,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_file_path=\'nonexisting_dir/\'',0
 
 TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'SHOW WARNINGS',0
 
 TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'show status like \'server_audit_current_log\'',0
 
 TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'show variables like \'server_audit%\'',0
 
mysqltest: Result length mismatch
 
 - saving '/home/travis/build/MariaDB/server/mysql-test/var/4/log/plugins.server_audit/' to '/home/travis/build/MariaDB/server/mysql-test/var/log/plugins.server_audit/'
 
];mtr: spent 0:01:24 on 239 tests. 0:02:04 (354 tests) leftplugins.thread_pool_server_audit         w2 [ fail ]
 
        Test ended at 2017-06-03 01:45:44
 
CURRENT_TEST: plugins.thread_pool_server_audit
 
--- /home/travis/build/MariaDB/server/mysql-test/suite/plugins/r/thread_pool_server_audit.result	2017-06-03 01:12:33.602546287 +0000
 
+++ /home/travis/build/MariaDB/server/mysql-test/suite/plugins/r/thread_pool_server_audit.reject	2017-06-03 01:45:43.754546287 +0000



 Comments   
Comment by Elena Stepanova [ 2017-06-11 ]

It's not replace_regex, it's cat_file that gives.

As we can see in the output above, the previous identical line replace-regexed just fine. The faulty line happens to be just outside 16384-symbol buffer which cat_file allocates. Increasing the buffer makes the problem go away.

serg, Monty increased the buffer from 512 to 16384 in 2013. Is it okay to increase it again, or should it be solved in a smarter way?

Comment by Daniel Black [ 2017-06-12 ]

Thanks elenst.

Generated at Thu Feb 08 08:02:09 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.