Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

domain(localhost) is empty #46062

Open
khamin opened this issue Feb 6, 2023 · 3 comments
Open

domain(localhost) is empty #46062

khamin opened this issue Feb 6, 2023 · 3 comments

Comments

@khamin
Copy link

khamin commented Feb 6, 2023

Describe the unexpected behaviour

SELECT domain('http://localhost') return empty string.

How to reproduce

  • Which ClickHouse server version to use: 22.12.2

Expected behavior

Should return localhost.
Same for other single-level domains.

@cangyin
Copy link
Contributor

cangyin commented Feb 6, 2023

That is expected. From comment of FunctionDomain, it returns:

/// Extracts host from given url.
///
/// @return empty string view if the host is not valid (i.e. it does not have dot, or there no symbol after dot).
inline std::string_view getURLHost(const char * data, size_t size)

@khamin
Copy link
Author

khamin commented Feb 6, 2023

That is expected. From comment of FunctionDomain, it returns:

/// Extracts host from given url.
///
/// @return empty string view if the host is not valid (i.e. it does not have dot, or there no symbol after dot).
inline std::string_view getURLHost(const char * data, size_t size)

It does not change the fact that localhost is a valid domain.

@den-crane
Copy link
Contributor

duplicate #31106

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants