Core has a function to see if a user has bought a particular product by ID:
wc_customer_bought_product()
https://github.com/woothemes/woocommerce/blob/0da69f2bef9f454945ebbaac581d1073655c8569/includes/wc-user-functions.php#L242-L254
This query can be adapted to return all, however, it will be slow so be careful with usage and ensure its cached.
$ids = $wpdb->get_col(
$wpdb->prepare( "
SELECT im.meta_value FROM {$wpdb->posts} AS p
INNER JOIN {$wpdb->postmeta} AS pm ON p.ID = pm.post_id
INNER JOIN {$wpdb->prefix}woocommerce_order_items AS i ON p.ID = i.order_id
INNER JOIN {$wpdb->prefix}woocommerce_order_itemmeta AS im ON i.order_item_id = im.order_item_id
WHERE p.post_status IN ( 'wc-completed', 'wc-processing' )
AND pm.meta_key = '_customer_user'
AND im.meta_key IN ( '_product_id', '_variation_id' )
AND pm.meta_value = %d
", $user_id
)
);