-
Notifications
You must be signed in to change notification settings - Fork 165
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
Feat: Add Mysql2 and Trilogy db.collection.name
attribute
#1109
Open
hannahramadan
wants to merge
13
commits into
open-telemetry:main
Choose a base branch
from
hannahramadan:mysql_libs_db_collection_name
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 10 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
43d24ee
Add Mysql2 and Trilogy collection_name attribute
hannahramadan 8bd5818
Remove empty line
hannahramadan 146bd71
Appease rubocop
hannahramadan f9c244e
Refactor compact!
hannahramadan 6047052
Apply suggestions from code review
hannahramadan cc43b33
Merge branch 'main' into mysql_libs_db_collection_name
kaylareopelle b61e51e
Update to older semantic convention
hannahramadan bc7df18
Merge branch 'mysql_libs_db_collection_name' of https://github.com/ha…
hannahramadan a23b954
Update regex
hannahramadan f099af3
Use correct variable
hannahramadan 8134ee3
Go directly to matching data vs MatchData object
hannahramadan 8328668
Feature flag
hannahramadan 8f42fa2
No nils
hannahramadan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
[ | ||
{ | ||
"name": "from", | ||
"sql": "SELECT * FROM test_table" | ||
}, | ||
{ | ||
"name": "select_count_from", | ||
"sql": "SELECT COUNT(*) FROM test_table WHERE condition" | ||
}, | ||
{ | ||
"name": "from_with_subquery", | ||
"sql": "SELECT * FROM (SELECT * FROM test_table) AS table_alias" | ||
}, | ||
{ | ||
"name": "insert_into", | ||
"sql": "INSERT INTO test_table (column1, column2) VALUES (value1, value2)" | ||
}, | ||
{ | ||
"name": "update", | ||
"sql": "UPDATE test_table SET column1 = value1 WHERE condition" | ||
}, | ||
{ | ||
"name": "delete_from", | ||
"sql": "DELETE FROM test_table WHERE condition" | ||
}, | ||
{ | ||
"name": "create_table", | ||
"sql": "CREATE TABLE test_table (column1 datatype, column2 datatype)" | ||
}, | ||
{ | ||
"name": "create_table_if_not_exists", | ||
"sql": "CREATE TABLE IF NOT EXISTS test_table (column1 datatype, column2 datatype)" | ||
}, | ||
{ | ||
"name": "alter_table", | ||
"sql": "ALTER TABLE test_table ADD column_name datatype" | ||
}, | ||
{ | ||
"name": "drop_table", | ||
"sql": "DROP TABLE test_table" | ||
}, | ||
{ | ||
"name": "drop_table_if_exists", | ||
"sql": "DROP TABLE IF EXISTS test_table" | ||
}, | ||
{ | ||
"name": "insert_into", | ||
"sql": "INSERT INTO test_table values('', 'a''b c',0, 1 , 'd''e f''s h')" | ||
}, | ||
{ | ||
"name": "from_with_join", | ||
"sql": "SELECT columns FROM test_table JOIN table2 ON test_table.column = table2.column" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
[ | ||
{ | ||
"name": "from", | ||
"sql": "SELECT * FROM test_table" | ||
}, | ||
{ | ||
"name": "select_count_from", | ||
"sql": "SELECT COUNT(*) FROM test_table WHERE condition" | ||
}, | ||
{ | ||
"name": "from_with_subquery", | ||
"sql": "SELECT * FROM (SELECT * FROM test_table) AS table_alias" | ||
}, | ||
{ | ||
"name": "insert_into", | ||
"sql": "INSERT INTO test_table (column1, column2) VALUES (value1, value2)" | ||
}, | ||
{ | ||
"name": "update", | ||
"sql": "UPDATE test_table SET column1 = value1 WHERE condition" | ||
}, | ||
{ | ||
"name": "delete_from", | ||
"sql": "DELETE FROM test_table WHERE condition" | ||
}, | ||
{ | ||
"name": "create_table", | ||
"sql": "CREATE TABLE test_table (column1 datatype, column2 datatype)" | ||
}, | ||
{ | ||
"name": "create_table_if_not_exists", | ||
"sql": "CREATE TABLE IF NOT EXISTS test_table (column1 datatype, column2 datatype)" | ||
}, | ||
{ | ||
"name": "alter_table", | ||
"sql": "ALTER TABLE test_table ADD column_name datatype" | ||
}, | ||
{ | ||
"name": "drop_table", | ||
"sql": "DROP TABLE test_table" | ||
}, | ||
{ | ||
"name": "drop_table_if_exists", | ||
"sql": "DROP TABLE IF EXISTS test_table" | ||
}, | ||
{ | ||
"name": "insert_into", | ||
"sql": "INSERT INTO test_table values('', 'a''b c',0, 1 , 'd''e f''s h')" | ||
}, | ||
{ | ||
"name": "from_with_join", | ||
"sql": "SELECT columns FROM test_table JOIN table2 ON test_table.column = table2.column" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could probably look this up myself but...
How does
Regexp.last_match
work?Is this thread safe?
What happens if you are in a multi-threaded worker and an unrelated Regexp runs. Will it return the
last_match
from an unexpected regular expression?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regexp.last_match(1)
is returning the first matched result and stopping. Since we just need the first match, this approach is faster than the previously used.scan
, which was capturing every single match.Re thread safety: I think so. Here's a StackOverflow answer that talks a bit about it. Because its being called inside an instance method,
Regexp.last_match()
should only be yielding the last capture that was evaluated inside the method, so no clobbering should be taking place.