diff --git a/tests/phpunit/tests/meta/query.php b/tests/phpunit/tests/meta/query.php
index 6050676..972b4a6 100644
--- a/tests/phpunit/tests/meta/query.php
+++ b/tests/phpunit/tests/meta/query.php
@@ -884,4 +884,23 @@ class Tests_Meta_Query extends WP_UnitTestCase {
 
 		$this->assertTrue( $q->has_or_relation() );
 	}
+        
+        /**
+         * @ticket 42409
+         * @global type $wpdb
+         */
+        
+        public function test_compare_meta_key(){
+            global $wpdb;
+            $meta_key='foo_bar';
+            $q=new WP_Meta_Query([array(
+                'compare_key'=>'LIKE',
+                'key'=>$meta_key
+                    )]);
+            $sql=$q->get_sql('post', $wpdb->posts, 'ID', $this);
+            
+            $this->assertRegexp("/{$wpdb->postmeta}\.meta_key LIKE %{$wpdb->esc_like($meta_key)}%/", $sql['where']);
+            
+        }
+
 }
