‘Select All Visible’ vs ‘Select All’ with pagination

Suppose I have a table with pagination due a lot of row entries. Should the default action for 'Select all' select the entries on the current page or all entries in the entire table (i.e. all pages)?

What is the intended behaviour for a user?

I am aware of the solution that Gmail has to address this where it selects the ones in view and prompts an action to select all. Just wondering where I could find some other examples of products tackling this.