Граф коммитов

462 Коммитов

Автор SHA1 Сообщение Дата
Alain Jobart d9066317c1 Removing cbson. We'll remove bson support eventually. 2015-10-01 07:29:09 -07:00
Ammar Aijazi d96f036b7c Addressing code review comments to fix minor style issues 2015-09-30 15:03:19 -07:00
Ammar Aijazi eb76778fa3 Fix up vtgatev3 Python client to support caller id and new-style errors 2015-09-29 18:26:32 -07:00
Ammar Aijazi 3b6b0276a8 Make vtgatev2 client extract errors from RPC response, and stop string parsing those errors 2015-09-29 16:56:58 -07:00
Ammar Aijazi ee865b0fea Rename dbexceptions.RequestBacklog to dbexceptions.TransientError 2015-09-28 18:26:28 -07:00
Alain Jobart 01d6e62ecb The query rules are not a global variable any more.
It's prettier this way, and doesn't mess us vtcombo.
2015-09-24 10:44:41 -07:00
Alain Jobart 0f67e8567f Small fix so vtagte_addr() works. 2015-09-24 10:44:41 -07:00
Ammar Aijazi 4cba9d02c1 vtdb.tablet client uses error codes to return errors instead of string parsing 2015-09-23 15:58:59 -07:00
Alain Jobart d3c42c0941 Adding support for vtcombo in vttest framework. 2015-09-23 13:10:26 -07:00
Dean Yasuda fb8d99d1af Merge branch 'master' into batch 2015-09-22 11:26:10 -07:00
Dean Yasuda 7001985e2c Refactor vtgatev2 execute calls.
This will make vtgatev2.py more readable.
2015-09-22 11:22:44 -07:00
Alain Jobart 85201575c3 Moving mysql config to implementation class. 2015-09-22 09:33:26 -07:00
Alain Jobart eb8bc86677 Simplifying a few things. 2015-09-22 09:21:11 -07:00
Alain Jobart 367f444562 Fixing a couple tiny details. 2015-09-22 08:18:28 -07:00
Alain Jobart 291dc264f9 Fixing go vttest for vitess cluster. 2015-09-22 08:12:13 -07:00
Sugu Sougoumarane 1233a242f0 vttest: make the code more generic 2015-09-20 00:39:37 -07:00
Dean Yasuda 604cd01259 Support ExecuteBatchShard in vtgatev2.py.
Change the vtgateclienttest/services/callerid.go test to always return
an error when callerid is handled. The error will contain word
"SUCCESS:" if callerid matches. This is necessary since falling through
breaks the expectations of the caller.

In the connection's _execute_batch call, some routing will be
keyspace_ids, and some will be by shards. This means that an
_execute_batch may create both a ExecuteBatchKeyspaceIds and
ExecuteBatchShard call. Merge the results back together.

Add tests for ExecuteBatchShard in python_client_test.py and
vtgatev2_test.py.
2015-09-18 16:10:39 -07:00
Sugu Sougoumarane f714110842 Merge branch 'master' into suguwork 2015-09-18 02:22:03 -07:00
Sugu Sougoumarane 8f4b76546a vttest: address review comments 2015-09-18 01:35:06 -07:00
Sugu Sougoumarane 4bc7189ca2 vttest: add mysql_only option 2015-09-18 01:17:04 -07:00
Sugu Sougoumarane a2a037e105 vttest: make run_local_database more flexible
Two changes here:
- Make the test use VTDATAROOT if it's specified
- Use mysql flavor-specific initialization based on MYSQL_FLAVOR
2015-09-18 00:44:35 -07:00
Ammar Aijazi 6df8aa6133 Remove RPCError from proto3 responses where it's unused 2015-09-17 15:15:59 -07:00
Dean Yasuda b7553afaa7 Clean up VTGateCursor execute methods.
Every vtgate_cursor.VTGateCursor.execute* method should eliminate
results of prior executemany calls.
2015-09-17 09:00:26 -07:00
Dean Yasuda 8140617001 Combine vtgate_cursor.BatchVTGateCursor.
Since BatchVTGateCursor only adds executemany and nextset functionality,
just add that functionality to vtgate_cursor.VTGateCursor. Fix tests and
code that refers to BatchVTGateCursor.
2015-09-17 08:55:31 -07:00
Dean Yasuda 4d8cb66908 Add BatchVTGateCursor.executemany.
To comply with PEP0249, remove the BatchVTGateCursor execute and flush
sequence and use executemany instead. The first argument to executemany
is sql if all commands share a common sql (this is supposed to be an
"operation" parameter). The params_list will supply sql if the first
argument is None.

Each params in the executeany params_list generates a result set.
Implement the nextset() to walk through the result_set.

Update tests to use the new BatchVTGateCursor API.
2015-09-17 03:35:50 -07:00
Dean Yasuda 0343bd6ba4 Fix potential vtgatev2 stream cursor bug.
Always open a new connection for every stream_execute. Reusing an
existing connection may cause problems if you are in a transaction; this
logic is simpler.

Also, change the cursor._get_conn() method into a cursor.connection property.
2015-09-15 14:27:48 -07:00
Dean Yasuda 2753ed386c Merge branch 'master' into callerid4 2015-09-14 08:48:40 -07:00
Dean Yasuda d11c5ec854 Remove cursor effective_caller_id parameters.
Only cursor.set_effective_caller_id(effective_caller_id) is now
supported. Sending effective_caller_id as an argument to PEP0249
functions will fail or be ignored.
2015-09-14 05:34:02 -07:00
Alain Jobart 13fc216b65 Fixing failing tests. 2015-09-13 19:16:40 -07:00
Alain Jobart 838d75f7fb Merge branch 'master' into replication 2015-09-13 17:57:14 -07:00
Alain Jobart 02fa09fb8a Fixing bson python client for srvkeyspace transition. 2015-09-13 17:56:25 -07:00
Dean Yasuda 715fc9c671 Fix some lint errors, missing init. 2015-09-13 04:07:20 -07:00
Dean Yasuda c7318f2495 Fix tablet.py bug in prev commit.
I did not finish reorganizing tablet's _stream_execute
method.
2015-09-12 20:21:15 -07:00
Dean Yasuda 0d7f6a8b70 Merge branch 'master' into stream 2015-09-12 17:44:03 -07:00
Dean Yasuda faa72fc805 Python cursor changes.
In base cursor classes, Make set_effective_caller_id a separate call
rather than passing effective_caller_id through interfaces (cleanup to
come later).

Remove some try-except log-and-raise wrappers in vtgatev2 test methods.
The default logging, and put the logging in get_connection instead.
2015-09-12 17:15:32 -07:00
Dean Yasuda 5bb9a4bc6b Allow multiple vtgate stream_execute calls.
Vtgate connection stream_execute now detaches the BsonRPCClient from the
connection and closes it after the generator exits. The connection will
quietly open a new BsonRPCClient if another execute is called.
2015-09-11 15:18:46 -07:00
Alain Jobart fe2bcecfb2 Fixing a couple exceptions. 2015-09-11 13:13:39 -07:00
Alain Jobart 80ca29cedc Small clean-up. 2015-09-11 12:50:18 -07:00
Alain Jobart 318af78ad6 Switching to beta versions of protobuf and grpc.
Fixing python clients to work.
2015-09-11 11:55:54 -07:00
Alain Jobart 1f94d704cb Changing Sql in binlog to always be a string too. 2015-09-11 07:53:47 -07:00
Alain Jobart 3b830cd986 Changing sql from []byte to string in proto3. 2015-09-11 07:26:19 -07:00
Dean Yasuda 2803385021 Reorganize python base cursor classes.
Add more tests to vtgatev2_test.py. Try to make vtgatev2 able to
break out of a stream_execute and restart. This needs more work.
2015-09-11 06:37:44 -07:00
Dean Yasuda e55bb14d67 Add py/vtdb/base_cursor.py to consolidate cursors.
Move some common code into base_cursor.py.

Make the third_party StreamCursor._stream_execute return generators and
migrate stage variables out of the vitess clients.
2015-09-07 18:25:12 -07:00
Dean Yasuda 4bbd90babd Clean up py/vtdb class variables.
Remove class variables that shadow object variables. These are a
potential source of hard-to-find bugs. Move initial values into object
__init__ methods instead.
2015-09-06 10:56:29 -07:00
Ammar Aijazi a7e7a5f412 Merge pull request #1059 from aaijazi/aaijazi_err_codes_in_queryservice
Queryservice fixes to use vtrpc.ErrorCodes
2015-08-31 14:22:14 -07:00
Dean Yasuda 026731c9f9 Fix another syntax error. 2015-08-30 22:40:28 -07:00
Dean Yasuda 91318ff64d Fix a few more python lint errors. 2015-08-30 22:03:22 -07:00
Dean Yasuda f636e15166 Second pass of python lint fixes.
This is the first pass for some subdirectories.

Recurring issues include:

1. Inconsistent quote chars. Use the same quote character as the first
use in the file (usually single-quote). Double quotes are OK if the
quoted string contains single quotes.

2. Bad indentation. Indent 2 for logic, 4 for continuations if the
previous line ends with '(', '[', or '{'. If drop does not immediately
follow the group-symbol, align with the opening group-symbol. I suggest
immediate drops, since these are stable if the content of the first
line changes, while aligning with the opening group-symbol requires
shifting the continuation lines.

3. Bad docstrings. A full docstring looks like:

   """Initial line ending with punctuation.

   Optional text.

   Args:
     Arg1: Description.
     Arg2: Description with
         indented continuation.

   Returns:
     Return text.

   Raises:
     ErrorClass: Description.
   """

4. Vertical spacing. Exactly two blank lines before top-level classes
or functions. Exactly one blank line before non-top-level classes or
functions. No more than one blank line within top-level constructs.
2015-08-30 09:32:00 -07:00
Ammar Aijazi 11d903f17b Queryservice server-side changes needed for using vtrpc.ErrorCodes 2015-08-29 17:47:42 -07:00
Dean Yasuda 4c61dd2f3f In sql_builder, rename Or to OrExprs, add AfterPrevValues.
The rename makes it clear that this is to OR non-trivial statements
for a single column together, not a general purpose OR, and not to
be used when a simple IN statement could be used.

AfterPrevValues is used for multi-dimensional, ordered traversal after
a continuation point.
2015-08-27 12:10:04 -07:00