$wpdb->query()
returns number of rows affected by the query. It’s returning NULL
indicates that there is an error in your query.
The problem with your query is that you are updating $wpdb->posts
table, but the condition depends on $wpdb->postmeta
table. You have to join these tables for the query to work.
Another problem is that you have to place the post inside quote
$wpdb->posts.post_type="post"
Try the following query
global $wpdb;
$result = $wpdb->query("UPDATE $wpdb->posts
INNER JOIN $wpdb->postmeta
ON $wpdb->posts.ID = $wpdb->postmeta.post_id
SET $wpdb->posts.post_type="editorial_post"
WHERE $wpdb->posts.post_type="post"
AND $wpdb->postmeta.meta_key = 'tag'
AND $wpdb->postmeta.meta_value="editorial"");
var_dump($result);