Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
"""This file contains a collection of standard key derivation functions.

A key derivation function derives one or more secondary secret keys from
one primary secret (a master key or a pass phrase).
one primary secret (a main key or a pass phrase).

This is typically done to insulate the secondary keys from each other,
to avoid that leakage of a secondary key compromises the security of the
master key, or to thwart attacks on pass phrases (e.g. via rainbow tables).
main key, or to thwart attacks on pass phrases (e.g. via rainbow tables).

:undocumented: __revision__
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ class RefreshOption(_Constants):
'HOSTS': (1 << 3, 'Flush host cache'),
'STATUS': (1 << 4, 'Flush status variables'),
'THREADS': (1 << 5, 'Flush thread cache'),
'SLAVE': (1 << 6, 'Reset master info and restart slave thread'),
'SLAVE': (1 << 6, 'Reset main info and restart subordinate thread'),
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@
CR_EMBEDDED_CONNECTION = u"Embedded server"
CR_PROBE_SLAVE_STATUS = u"Error on SHOW SLAVE STATUS:"
CR_PROBE_SLAVE_HOSTS = u"Error on SHOW SLAVE HOSTS:"
CR_PROBE_SLAVE_CONNECT = u"Error connecting to slave:"
CR_PROBE_MASTER_CONNECT = u"Error connecting to master:"
CR_PROBE_SLAVE_CONNECT = u"Error connecting to subordinate:"
CR_PROBE_MASTER_CONNECT = u"Error connecting to main:"
CR_SSL_CONNECTION_ERROR = u"SSL connection error: %-.100s"
CR_MALFORMED_PACKET = u"Malformed packet"
CR_WRONG_LICENSE = u"This client library is licensed only for use with MySQL servers having '%s' license"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def update(self, dest, rev_options):
self.run_command(['fetch', '-q', '--tags'], cwd=dest)
else:
self.run_command(['fetch', '-q'], cwd=dest)
# Then reset to wanted revision (maybe even origin/master)
# Then reset to wanted revision (maybe even origin/main)
rev_options = self.check_rev_options(dest, rev_options)
cmd_args = ['reset', '--hard', '-q'] + rev_options.to_args()
self.run_command(cmd_args, cwd=dest)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -558,9 +558,9 @@ def __init__(self, entries=None):
self.add_entry(entry)

@classmethod
def _build_master(cls):
def _build_main(cls):
"""
Prepare the master working set.
Prepare the main working set.
"""
ws = cls()
try:
Expand Down Expand Up @@ -3086,9 +3086,9 @@ def _initialize(g=globals()):


@_call_aside
def _initialize_master_working_set():
def _initialize_main_working_set():
"""
Prepare the master working set and make the ``require()``
Prepare the main working set and make the ``require()``
API available.

This function has explicit effects on the global state
Expand All @@ -3098,7 +3098,7 @@ def _initialize_master_working_set():
Invocation by other packages is unsupported and done
at their own risk.
"""
working_set = WorkingSet._build_master()
working_set = WorkingSet._build_main()
_declare_state('object', working_set=working_set)

require = working_set.require
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1152,25 +1152,25 @@ def get_schema_names(self, connection, **kw):
def get_table_names(self, connection, schema=None, **kw):
if schema is not None:
qschema = self.identifier_preparer.quote_identifier(schema)
master = '%s.sqlite_master' % qschema
main = '%s.sqlite_main' % qschema
else:
master = "sqlite_master"
main = "sqlite_main"
s = ("SELECT name FROM %s "
"WHERE type='table' ORDER BY name") % (master,)
"WHERE type='table' ORDER BY name") % (main,)
rs = connection.execute(s)
return [row[0] for row in rs]

@reflection.cache
def get_temp_table_names(self, connection, **kw):
s = "SELECT name FROM sqlite_temp_master "\
s = "SELECT name FROM sqlite_temp_main "\
"WHERE type='table' ORDER BY name "
rs = connection.execute(s)

return [row[0] for row in rs]

@reflection.cache
def get_temp_view_names(self, connection, **kw):
s = "SELECT name FROM sqlite_temp_master "\
s = "SELECT name FROM sqlite_temp_main "\
"WHERE type='view' ORDER BY name "
rs = connection.execute(s)

Expand All @@ -1185,11 +1185,11 @@ def has_table(self, connection, table_name, schema=None):
def get_view_names(self, connection, schema=None, **kw):
if schema is not None:
qschema = self.identifier_preparer.quote_identifier(schema)
master = '%s.sqlite_master' % qschema
main = '%s.sqlite_main' % qschema
else:
master = "sqlite_master"
main = "sqlite_main"
s = ("SELECT name FROM %s "
"WHERE type='view' ORDER BY name") % (master,)
"WHERE type='view' ORDER BY name") % (main,)
rs = connection.execute(s)

return [row[0] for row in rs]
Expand All @@ -1198,20 +1198,20 @@ def get_view_names(self, connection, schema=None, **kw):
def get_view_definition(self, connection, view_name, schema=None, **kw):
if schema is not None:
qschema = self.identifier_preparer.quote_identifier(schema)
master = '%s.sqlite_master' % qschema
main = '%s.sqlite_main' % qschema
s = ("SELECT sql FROM %s WHERE name = '%s'"
"AND type='view'") % (master, view_name)
"AND type='view'") % (main, view_name)
rs = connection.execute(s)
else:
try:
s = ("SELECT sql FROM "
" (SELECT * FROM sqlite_master UNION ALL "
" SELECT * FROM sqlite_temp_master) "
" (SELECT * FROM sqlite_main UNION ALL "
" SELECT * FROM sqlite_temp_main) "
"WHERE name = '%s' "
"AND type='view'") % view_name
rs = connection.execute(s)
except exc.DBAPIError:
s = ("SELECT sql FROM sqlite_master WHERE name = '%s' "
s = ("SELECT sql FROM sqlite_main WHERE name = '%s' "
"AND type='view'") % view_name
rs = connection.execute(s)

Expand Down Expand Up @@ -1550,15 +1550,15 @@ def _get_table_sql(self, connection, table_name, schema=None, **kw):
schema_expr = ""
try:
s = ("SELECT sql FROM "
" (SELECT * FROM %(schema)ssqlite_master UNION ALL "
" SELECT * FROM %(schema)ssqlite_temp_master) "
" (SELECT * FROM %(schema)ssqlite_main UNION ALL "
" SELECT * FROM %(schema)ssqlite_temp_main) "
"WHERE name = '%(table)s' "
"AND type = 'table'" % {
"schema": schema_expr,
"table": table_name})
rs = connection.execute(s)
except exc.DBAPIError:
s = ("SELECT sql FROM %(schema)ssqlite_master "
s = ("SELECT sql FROM %(schema)ssqlite_main "
"WHERE name = '%(table)s' "
"AND type = 'table'" % {
"schema": schema_expr,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
SQLAlchemy/Alembic themselves without the need to ship/install a separate
package outside of SQLAlchemy.

NOTE: copied/adapted from SQLAlchemy master for backwards compatibility;
NOTE: copied/adapted from SQLAlchemy main for backwards compatibility;
this should be removable when Alembic targets SQLAlchemy 1.0.0.

"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ def _engine_uri(options, file_config):
config._current = None
for db_url in db_urls:

if options.write_idents and provision.FOLLOWER_IDENT: # != 'master':
if options.write_idents and provision.FOLLOWER_IDENT: # != 'main':
with open(options.write_idents, "a") as file_:
file_.write(provision.FOLLOWER_IDENT + " " + db_url + "\n")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ def __call__(self, parser, namespace,


def pytest_configure(config):
if hasattr(config, "slaveinput"):
plugin_base.restore_important_follower_config(config.slaveinput)
if hasattr(config, "subordinateinput"):
plugin_base.restore_important_follower_config(config.subordinateinput)
plugin_base.configure_follower(
config.slaveinput["follower_ident"]
config.subordinateinput["follower_ident"]
)
else:
if config.option.write_idents and \
Expand All @@ -87,18 +87,18 @@ def pytest_sessionfinish(session):
import uuid

def pytest_configure_node(node):
# the master for each node fills slaveinput dictionary
# the main for each node fills subordinateinput dictionary
# which pytest-xdist will transfer to the subprocess

plugin_base.memoize_important_follower_config(node.slaveinput)
plugin_base.memoize_important_follower_config(node.subordinateinput)

node.slaveinput["follower_ident"] = "test_%s" % uuid.uuid4().hex[0:12]
node.subordinateinput["follower_ident"] = "test_%s" % uuid.uuid4().hex[0:12]
from sqlalchemy.testing import provision
provision.create_follower_db(node.slaveinput["follower_ident"])
provision.create_follower_db(node.subordinateinput["follower_ident"])

def pytest_testnodedown(node, error):
from sqlalchemy.testing import provision
provision.drop_follower_db(node.slaveinput["follower_ident"])
provision.drop_follower_db(node.subordinateinput["follower_ident"])


def pytest_collection_modifyitems(session, config, items):
Expand Down